Skip to content

Commit

Permalink
Memory Zone: Re-enabled block sequences
Browse files Browse the repository at this point in the history
Optimizes rover scanning by skipping over block sequences
known to be unpurgable and contiguous.
  • Loading branch information
skyjake committed Feb 23, 2012
1 parent b59482c commit a9b0cb4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions doomsday/engine/portable/src/dd_zone.c
Expand Up @@ -442,7 +442,6 @@ void *Z_Malloc(size_t size, int tag, void *user)
for(volume = volumeRoot; ; volume = volume->next)
{
uint numChecked = 0;
size_t bytesChecked = 0;

if(volume == NULL)
{
Expand Down Expand Up @@ -509,14 +508,12 @@ void *Z_Malloc(size_t size, int tag, void *user)
// We will scan ahead starting until we find something big enough.
for(;; numChecked++)
{
bytesChecked += base->size;

// Is this a suitable block?
if(!base->user && base->size >= size)
if(isFreeBlock(base) && base->size >= size)
break; // We'll take it!

// Check for purgable blocks we can dispose of.
if(base->user)
if(!isFreeBlock(base))
{
if(base->tag >= PU_PURGELEVEL)
{
Expand Down Expand Up @@ -607,7 +604,6 @@ void *Z_Malloc(size_t size, int tag, void *user)
}
base->tag = tag;

/*
if(tag == PU_MAPSTATIC)
{
// Level-statics are linked into unpurgable sequences so they can
Expand All @@ -620,7 +616,7 @@ void *Z_Malloc(size_t size, int tag, void *user)
base->seqFirst->seqLast = base;
}
}
else*/
else
{
// Not part of a sequence.
base->seqLast = base->seqFirst = NULL;
Expand Down

0 comments on commit a9b0cb4

Please sign in to comment.