pike.git / src / block_allocator.c

version» Context lines:

pike.git/src/block_allocator.c:120:    if (a->l.alignment) {    if (a->l.alignment & (a->l.alignment - 1))    Pike_fatal("Block allocator a->l.alignment is not a power of 2.\n");    if (block_size & (a->l.alignment-1))    Pike_fatal("Block allocator block size is not aligned.\n");    a->l.doffset = PIKE_ALIGNTO(sizeof(struct ba_page), a->l.alignment);    } else {    a->l.doffset = sizeof(struct ba_page);    }    +  if (a->l.blocks & (a->l.blocks - 1))    a->l.blocks = round_up32(a->l.blocks);    a->l.block_size = block_size;    a->l.offset = block_size * (a->l.blocks-1);   }      PMOD_EXPORT void ba_init_aligned(struct block_allocator * a, unsigned INT32 block_size,    unsigned INT32 blocks, unsigned INT32 alignment) {    a->l.blocks = blocks;    a->l.block_size = block_size;    a->l.alignment = alignment;