Example #1
0
void *kmalloc(unsigned int size)
{
    int indx = kmalloc_index(size);
    if (indx < 0)
        return NULL;
    return kmem_cache_alloc(&kmalloc_cache[indx]);
}
Example #2
0
void * kmalloc(size_t size)
{
    size_t index = kmalloc_index(size);
    struct kmem_cache *cache = &kmalloc_caches[index];
    return alloc_object(cache);
}