Subversion Repositories HelenOS

Rev

Rev 4174 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4174 Rev 4303
Line 934... Line 934...
934
/**************************************/
934
/**************************************/
935
/* kalloc/kfree functions             */
935
/* kalloc/kfree functions             */
936
void *malloc(unsigned int size, int flags)
936
void *malloc(unsigned int size, int flags)
937
{
937
{
938
    ASSERT(_slab_initialized);
938
    ASSERT(_slab_initialized);
939
    ASSERT(size && size <= (1 << SLAB_MAX_MALLOC_W));
939
    ASSERT(size <= (1 << SLAB_MAX_MALLOC_W));
940
   
940
   
941
    if (size < (1 << SLAB_MIN_MALLOC_W))
941
    if (size < (1 << SLAB_MIN_MALLOC_W))
942
        size = (1 << SLAB_MIN_MALLOC_W);
942
        size = (1 << SLAB_MIN_MALLOC_W);
943
 
943
 
944
    int idx = fnzb(size - 1) - SLAB_MIN_MALLOC_W + 1;
944
    int idx = fnzb(size - 1) - SLAB_MIN_MALLOC_W + 1;