Lines Matching defs:blocks
41 /* Allocations from large blocks, no individual free's */
47 * to have space allocated via larger blocks of space.
48 * The only free allowed is of all the blocks and all the elements.
71 add_block(Blocks *blocks, int nbytes)
77 HPROF_ASSERT(blocks!=NULL);
80 header_size = real_size(blocks->alignment, sizeof(BlockHeader));
81 block_size = blocks->elem_size*blocks->population;
83 block_size = real_size(blocks->alignment, nbytes);
91 if ( blocks->current_block != NULL ) {
92 blocks->current_block->next = block_header;
94 blocks->current_block = block_header;
95 if ( blocks->first_block == NULL ) {
96 blocks->first_block = block_header;
104 Blocks *blocks;
110 blocks = (Blocks*)HPROF_MALLOC(sizeof(Blocks));
111 blocks->alignment = alignment;
112 blocks->elem_size = elem_size;
113 blocks->population = population;
114 blocks->first_block = NULL;
115 blocks->current_block = NULL;
116 return blocks;
121 blocks_alloc(Blocks *blocks, int nbytes)
127 HPROF_ASSERT(blocks!=NULL);
133 block = blocks->current_block;
134 nbytes = real_size(blocks->alignment, nbytes);
136 add_block(blocks, nbytes);
137 block = blocks->current_block;
148 blocks_term(Blocks *blocks)
152 HPROF_ASSERT(blocks!=NULL);
154 block = blocks->first_block;
162 HPROF_FREE(blocks);