Lines Matching defs:block

42   FreeListBlock *next;   /* The next block in the list */
48 unsigned blocking_factor; /* The number of nodes per block */
51 FreeListBlock *block; /* The head of the list of free-list blocks */
57 static void _thread_FreeListBlock(FreeList *fl, FreeListBlock *block);
68 * to allocate per block.
86 * Enfore a minimum block size.
107 fl->block = NULL;
110 * Allocate the first block of memory.
112 fl->block = _new_FreeListBlock(fl);
113 if(!fl->block) {
120 fl->free_list = fl->block->nodes;
138 FreeListBlock *block;
140 * Re-thread the nodes of each block into individual free-lists.
142 for(block=fl->block; block; block=block->next)
143 _thread_FreeListBlock(fl, block);
145 * Link all of the block freelists into one large freelist.
148 for(block=fl->block; block; block=block->next) {
150 * Locate the last node of the current block.
152 char *last_node = block->nodes + fl->node_size *
157 * new block the start of the freelist.
160 fl->free_list = block->nodes;
198 FreeListBlock *next = fl->block;
200 FreeListBlock *block = next;
201 next = block->next;
202 block = _del_FreeListBlock(block);
205 fl->block = NULL;
236 * another block of nodes.
239 FreeListBlock *block = _new_FreeListBlock(fl);
240 if(!block)
243 * Prepend the new block to the list of free-list blocks.
245 block->next = fl->block;
246 fl->block = block;
250 fl->free_list = fl->block->nodes;
332 * return FreeListBlock * The new linked block of free-list nodes,
337 FreeListBlock *block; /* The new block to be returned */
341 block = (FreeListBlock *) malloc(sizeof(FreeListBlock));
342 if(!block)
349 block->next = NULL;
350 block->nodes = NULL;
352 * Allocate the block of nodes.
354 block->nodes = (char *) malloc(fl->node_size * fl->blocking_factor);
355 if(!block->nodes)
356 return _del_FreeListBlock(block);
358 * Initialize the block as a linked list of FreeListNode's.
360 _thread_FreeListBlock(fl, block);
365 return block;
369 * Link each node of a freelist block to the node that follows it.
372 * fl FreeList * The freelist that contains the block.
373 * block FreeListBlock * The block to be threaded.
375 static void _thread_FreeListBlock(FreeList *fl, FreeListBlock *block)
377 char *mem = block->nodes;
385 * Delete a free-list block.
388 * fl FreeListBlock * The block to be deleted, or NULL.