BBlockCache: Initialize the mutex unconditionally.
Otherwise we may get assertion failures under the debug heaps.
This commit is contained in:
@@ -45,6 +45,8 @@ BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize,
|
|||||||
fFreeBlocks(0),
|
fFreeBlocks(0),
|
||||||
fBlockCount(blockCount)
|
fBlockCount(blockCount)
|
||||||
{
|
{
|
||||||
|
pthread_mutex_init(&fLock, NULL);
|
||||||
|
|
||||||
switch (allocationType) {
|
switch (allocationType) {
|
||||||
case B_OBJECT_CACHE:
|
case B_OBJECT_CACHE:
|
||||||
fAlloc = &operator new[];
|
fAlloc = &operator new[];
|
||||||
@@ -61,8 +63,6 @@ BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize,
|
|||||||
if (heap_debug_get_allocation_info != NULL)
|
if (heap_debug_get_allocation_info != NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pthread_mutex_init(&fLock, NULL);
|
|
||||||
|
|
||||||
// To properly maintain a list of free buffers, a buffer must be
|
// To properly maintain a list of free buffers, a buffer must be
|
||||||
// large enough to contain the _FreeBlock struct that is used.
|
// large enough to contain the _FreeBlock struct that is used.
|
||||||
if (blockSize < sizeof(_FreeBlock))
|
if (blockSize < sizeof(_FreeBlock))
|
||||||
|
|||||||
Reference in New Issue
Block a user