GEM v. TTM
Posted May 30, 2008 5:42 UTC (Fri) by jzbiciak
(✭ supporter ✭
Parent article: GEM v. TTM
The use of anonymous memory also raises some performance concerns: a first-person shooter game will not provide the same experience if its blood-and-gore textures must be continually paged in.
Ah, you brought back some
// You can pass a NULL user if the tag is < PU_PURGELEVEL.
#define MINFRAGMENT 64
( int size,
void* user )
size = (size + 3) & ~3;
// scan through the block list,
// looking for the first free block
// of sufficient size,
// throwing out any purgable blocks along the way.
// account for size of block header
size += sizeof(memblock_t);
// if there is a free block behind the rover,
// back up over them
base = mainzone->rover;
DOOM had a zone allocator setup where you could allocate purgable blocks. If you ran out of space, it's start purging space until there was room for the new allocation. Objects would register callbacks to handle being purged. :-)
The reason I remember it is that I had to hack around it when I made an embedded version of DOOM that directly memory mapped the WAD file rather than Z_Malloc'ing it. Finding all the places where WAD elements were being explicitly managed was no walk in the park. :-)
to post comments)