_FreeChunk(): When freeing a chunk from a formerly full meta chunk, we have
to add it back to its partial list or it would be leaked. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35266 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
707e415d47
commit
c3f84a1df5
@ -443,6 +443,13 @@ MemoryManager::_FreeChunk(Area* area, MetaChunk* metaChunk, Chunk* chunk,
|
||||
ASSERT(area->usedMetaChunkCount > 0);
|
||||
if (--area->usedMetaChunkCount == 0)
|
||||
_FreeArea(area, false, flags);
|
||||
} else if (metaChunk->usedChunkCount == metaChunk->chunkCount - 1) {
|
||||
// the meta chunk was full before -- add it back to its partial chunk
|
||||
// list
|
||||
if (metaChunk->chunkSize == SLAB_CHUNK_SIZE_SMALL)
|
||||
sPartialMetaChunksSmall.Add(metaChunk, false);
|
||||
else if (metaChunk->chunkSize == SLAB_CHUNK_SIZE_MEDIUM)
|
||||
sPartialMetaChunksMedium.Add(metaChunk, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user