Пример #1
0
void InitArenaPool(ArenaPool* pool, const char*, unsigned size, unsigned align)
{
     if (align == 0)
         align = ARENA_DEFAULT_ALIGN;
     pool->mask = BITMASK(CeilingLog2(align));
     pool->first.next = NULL;
     pool->first.base = pool->first.avail = pool->first.limit =
         (uword)ARENA_ALIGN(&pool->first + 1);
     pool->current = &pool->first;
     pool->arenasize = size;                                  
}
Пример #2
0
void InitArenaPool(ArenaPool *pool, const char* /*name*/,
                   unsigned int /*size*/, unsigned int align)
{
     unsigned int size = POOL_SIZE;
     if (align == 0)
         align = ARENA_DEFAULT_ALIGN;
     pool->mask = BITMASK(CeilingLog2(align));
     pool->first.next = NULL;
     pool->first.base = pool->first.avail = pool->first.limit =
         (uword)ARENA_ALIGN(pool, &pool->first + 1);
     pool->current = &pool->first;
     pool->arenasize = size;
     pool->largealloc = LARGE_ALLOCATION_CEIL(pool);
     pool->cumul = freelist_count*size;
}