slabs.c
/*
 * Figures out which slab class (chunk size) is required to store an item of
 * a given size.
 *
 * Given object size, return id to use when allocating/freeing memory for object
 * 0 means error: can't store such a large object
 */
Figures out which slab class (chunk size) is required to store an item of
a given size.

Given object size, return id to use when allocating/freeing memory for object
0 means error: can't store such a large object
Figures out which slab class ( chunk size ) is required to store an item of a given size . Given object size return id to use when allocating / freeing memory for object 0 means error : can ' t store such a large object
unsigned int slabs_clsid(const size_t size) {
    int res = POWER_SMALLEST;
    if (size == 0)
        return 0;
    while (size > slabclass[res].size)
        if (res++ == power_largest)     
            return 0;
    return res;
}
unsigned int slabs_clsid ( const size_t size ) { int res = POWER_SMALLEST ; if ( size == 0 ) return 0 ; while ( size > slabclass [ res ] . size ) if ( res ++ == power_largest ) return 0 ; return res ; }
Figures out which slab class (chunk size) is required to store an item of
 a given size.
Figures out which slab class ( chunk size ) is required to store an item of a given size .
/* won't fit in the biggest slab */