better handling of low memory situations inside constructor

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4568 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2003-09-08 19:47:29 +00:00
parent dfbe8043fa
commit 16ce982290
+2 -1
View File
@@ -47,7 +47,7 @@ BBlockCache::BBlockCache(uint32 blockCount,
uint32 allocationType)
: fFreeList(0),
fBlockSize(blockSize),
fFreeBlocks(blockCount),
fFreeBlocks(0),
fBlockCount(blockCount),
fLocker("some BBlockCache lock"),
fAlloc(0),
@@ -79,6 +79,7 @@ BBlockCache::BBlockCache(uint32 blockCount,
_FreeBlock *block = reinterpret_cast<_FreeBlock *>(fAlloc(blockSize));
if (!block)
break;
fFreeBlocks++;
block->next = fFreeList;
fFreeList = block;
DEBUG_ONLY(block->magic1 = MAGIC1);