Lines Matching refs:block

32 	int     tag;            // a tag of 0 is a free block
57 The rover can be left pointing at a non-empty block
76 memblock_t *block;
78 // set the entire zone to one free block
80 zone->blocklist.next = zone->blocklist.prev = block =
82 zone->blocklist.tag = 1; // in use block
85 zone->rover = block;
87 block->prev = block->next = &zone->blocklist;
88 block->tag = 0; // free block
89 block->id = ZONEID;
90 block->size = size - sizeof(memzone_t);
101 memblock_t *block, *other;
106 block = (memblock_t *) ( (byte *)ptr - sizeof(memblock_t));
107 if (block->id != ZONEID)
109 if (block->tag == 0)
112 block->tag = 0; // mark as free
114 other = block->prev;
116 { // merge with previous free block
117 other->size += block->size;
118 other->next = block->next;
120 if (block == mainzone->rover)
122 block = other;
125 other = block->next;
127 { // merge the next free block onto the end
128 block->size += other->size;
129 block->next = other->next;
130 block->next->prev = block;
132 mainzone->rover = block;
164 // scan through the block list looking for the first free block
167 size += sizeof(memblock_t); // account for size of block header
185 // found a block big enough
189 { // there will be a free fragment after the allocated block
192 newm->tag = 0; // free block
201 base->tag = tag; // no longer a free block
221 memblock_t *block;
225 for (block = zone->blocklist.next ; ; block = block->next)
227 Con_Printf ("block:%p size:%7i tag:%3i\n",
228 block, block->size, block->tag);
230 if (block->next == &zone->blocklist)
232 if ( (byte *)block + block->size != (byte *)block->next)
233 Con_Printf ("ERROR: block size does not touch the next block\n");
234 if ( block->next->prev != block)
235 Con_Printf ("ERROR: next block doesn't have proper back link\n");
236 if (!block->tag && !block->next->tag)
249 memblock_t *block;
251 for (block = mainzone->blocklist.next ; ; block = block->next)
253 if (block->next == &mainzone->blocklist)
255 if ( (byte *)block + block->size != (byte *)block->next)
256 Sys_Error ("Z_CheckHeap: block size does not touch the next block\n");
257 if ( block->next->prev != block)
258 Sys_Error ("Z_CheckHeap: next block doesn't have proper back link\n");
259 if (!block->tag && !block->next->tag)
368 // print the single block
676 Looks for a free block of memory between the high and low hunk marks