void *map; /* map of blocks */
unsigned int *bitmap; /* blocks free/busy map */
unsigned int free_blocks; /* free blocks */
unsigned int nr_blocks; /* total blocks */
unsigned int next_non_full;
int fd; /* memory backing fd */
void *map; /* map of blocks */
unsigned int *bitmap; /* blocks free/busy map */
unsigned int free_blocks; /* free blocks */
unsigned int nr_blocks; /* total blocks */
unsigned int next_non_full;
int fd; /* memory backing fd */
static struct pool mp[MAX_POOLS];
static unsigned int nr_pools;
static unsigned int last_pool;
static struct pool mp[MAX_POOLS];
static unsigned int nr_pools;
static unsigned int last_pool;
return 0;
out_unlink:
fprintf(stderr, "smalloc: failed adding pool\n");
if (pool->map)
munmap(pool->map, pool->mmap_size);
return 0;
out_unlink:
fprintf(stderr, "smalloc: failed adding pool\n");
if (pool->map)
munmap(pool->map, pool->mmap_size);
ret = add_pool(&mp[0], INITIAL_SIZE);
assert(!ret);
}
static void cleanup_pool(struct pool *pool)
{
ret = add_pool(&mp[0], INITIAL_SIZE);
assert(!ret);
}
static void cleanup_pool(struct pool *pool)
{