MemoryManager::_GetChunks(): Fixed incorrect check. The area structure offset

introduced in r37701 was not taken into account for computing the short meta
chunk size. Fixes the reopened #6237.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42385 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2011-07-06 20:23:42 +00:00
parent 1ea7b190fe
commit 1e393751ba
+3 -1
View File
@@ -952,8 +952,10 @@ MemoryManager::_GetChunks(MetaChunkList* metaChunkList, size_t chunkSize,
if (metaChunk == NULL) {
// try to get a free meta chunk
if ((SLAB_CHUNK_SIZE_LARGE - kAreaAdminSize) / chunkSize >= chunkCount)
if ((SLAB_CHUNK_SIZE_LARGE - SLAB_AREA_STRUCT_OFFSET - kAreaAdminSize)
/ chunkSize >= chunkCount) {
metaChunk = sFreeShortMetaChunks.RemoveHead();
}
if (metaChunk == NULL)
metaChunk = sFreeCompleteMetaChunks.RemoveHead();