Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/slab.c

    r55821eea r98000fb  
    130130/** Caches for malloc */
    131131static slab_cache_t *malloc_caches[SLAB_MAX_MALLOC_W - SLAB_MIN_MALLOC_W + 1];
    132 static const char *malloc_names[] =  {
     132static char *malloc_names[] =  {
    133133        "malloc-16",
    134134        "malloc-32",
     
    555555 * Initialize mag_cache structure in slab cache
    556556 */
    557 static bool make_magcache(slab_cache_t *cache)
     557static void make_magcache(slab_cache_t *cache)
    558558{
    559559        unsigned int i;
     
    562562
    563563        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);
    568565        for (i = 0; i < config.cpu_count; i++) {
    569566                memsetb(&cache->mag_cache[i], sizeof(cache->mag_cache[i]), 0);
     
    571568                    "slab_maglock_cpu");
    572569        }
    573         return true;
    574570}
    575571
    576572/** 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)
     573static 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)
    580577{
    581578        int pages;
     
    601598        spinlock_initialize(&cache->maglock, "slab_maglock");
    602599        if (!(cache->flags & SLAB_CACHE_NOMAGAZINE))
    603                 (void) make_magcache(cache);
     600                make_magcache(cache);
    604601
    605602        /* Compute slab sizes, object counts in slabs etc. */
     
    634631
    635632/** Create slab cache  */
    636 slab_cache_t *slab_cache_create(const char *name, size_t size, size_t align,
     633slab_cache_t *
     634slab_cache_create(char *name, size_t size, size_t align,
    637635    int (*constructor)(void *obj, int kmflag), int (*destructor)(void *obj),
    638636    int flags)
     
    855853                cache = list_get_instance(cur, slab_cache_t, link);
    856854
    857                 const char *name = cache->name;
     855                char *name = cache->name;
    858856                uint8_t order = cache->order;
    859857                size_t size = cache->size;
     
    898896                    NULL, NULL, SLAB_CACHE_MAGDEFERRED);
    899897        }
    900 #ifdef CONFIG_DEBUG
     898#ifdef CONFIG_DEBUG       
    901899        _slab_initialized = 1;
    902900#endif
     
    927925                    SLAB_CACHE_MAGDEFERRED)
    928926                        continue;
    929                 (void) make_magcache(s);
     927                make_magcache(s);
    930928                s->flags &= ~SLAB_CACHE_MAGDEFERRED;
    931929        }
Note: See TracChangeset for help on using the changeset viewer.