Changes in kernel/generic/src/mm/slab.c [55821eea:98000fb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/slab.c
r55821eea r98000fb 130 130 /** Caches for malloc */ 131 131 static slab_cache_t *malloc_caches[SLAB_MAX_MALLOC_W - SLAB_MIN_MALLOC_W + 1]; 132 static c onst char *malloc_names[] = {132 static char *malloc_names[] = { 133 133 "malloc-16", 134 134 "malloc-32", … … 555 555 * Initialize mag_cache structure in slab cache 556 556 */ 557 static boolmake_magcache(slab_cache_t *cache)557 static void make_magcache(slab_cache_t *cache) 558 558 { 559 559 unsigned int i; … … 562 562 563 563 cache->mag_cache = malloc(sizeof(slab_mag_cache_t) * config.cpu_count, 564 FRAME_ATOMIC); 565 if (!cache->mag_cache) 566 return false; 567 564 0); 568 565 for (i = 0; i < config.cpu_count; i++) { 569 566 memsetb(&cache->mag_cache[i], sizeof(cache->mag_cache[i]), 0); … … 571 568 "slab_maglock_cpu"); 572 569 } 573 return true;574 570 } 575 571 576 572 /** Initialize allocated memory as a slab cache */ 577 static void _slab_cache_create(slab_cache_t *cache, const char *name, 578 size_t size, size_t align, int (*constructor)(void *obj, int kmflag), 579 int (*destructor)(void *obj), int flags) 573 static void 574 _slab_cache_create(slab_cache_t *cache, char *name, size_t size, size_t align, 575 int (*constructor)(void *obj, int kmflag), int (*destructor)(void *obj), 576 int flags) 580 577 { 581 578 int pages; … … 601 598 spinlock_initialize(&cache->maglock, "slab_maglock"); 602 599 if (!(cache->flags & SLAB_CACHE_NOMAGAZINE)) 603 (void)make_magcache(cache);600 make_magcache(cache); 604 601 605 602 /* Compute slab sizes, object counts in slabs etc. */ … … 634 631 635 632 /** Create slab cache */ 636 slab_cache_t *slab_cache_create(const char *name, size_t size, size_t align, 633 slab_cache_t * 634 slab_cache_create(char *name, size_t size, size_t align, 637 635 int (*constructor)(void *obj, int kmflag), int (*destructor)(void *obj), 638 636 int flags) … … 855 853 cache = list_get_instance(cur, slab_cache_t, link); 856 854 857 c onst char *name = cache->name;855 char *name = cache->name; 858 856 uint8_t order = cache->order; 859 857 size_t size = cache->size; … … 898 896 NULL, NULL, SLAB_CACHE_MAGDEFERRED); 899 897 } 900 #ifdef CONFIG_DEBUG 898 #ifdef CONFIG_DEBUG 901 899 _slab_initialized = 1; 902 900 #endif … … 927 925 SLAB_CACHE_MAGDEFERRED) 928 926 continue; 929 (void)make_magcache(s);927 make_magcache(s); 930 928 s->flags &= ~SLAB_CACHE_MAGDEFERRED; 931 929 }
Note:
See TracChangeset
for help on using the changeset viewer.