mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Fixed memory statistics in debug build
This commit is contained in:
parent
1eb0c3d96a
commit
c84e436248
@ -368,7 +368,6 @@ public:
|
||||
|
||||
void resetExtent()
|
||||
{
|
||||
fb_assert(isExtent());
|
||||
hdrLength &= ~MEM_EXTENT;
|
||||
}
|
||||
|
||||
@ -394,6 +393,11 @@ public:
|
||||
{
|
||||
return hdrLength & MEM_ACTIVE;
|
||||
}
|
||||
#else
|
||||
bool isActive() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void assertBig()
|
||||
@ -2048,6 +2052,8 @@ MemPool::~MemPool(void)
|
||||
}
|
||||
else
|
||||
block->resetActive();
|
||||
|
||||
block->resetExtent();
|
||||
#endif
|
||||
parent->releaseBlock(block, false);
|
||||
}
|
||||
@ -2269,8 +2275,7 @@ void MemPool::releaseMemory(void* object, bool flagExtent) noexcept
|
||||
#ifdef VALIDATE_POOL
|
||||
MutexLockGuard guard(pool->mutex, "MemPool::releaseMemory");
|
||||
#endif
|
||||
if (flagExtent)
|
||||
block->resetExtent();
|
||||
fb_assert(block->isExtent() == flagExtent);
|
||||
|
||||
#ifdef DELAYED_FREE
|
||||
// Synchronize delayed free queue using pool mutex
|
||||
@ -2299,6 +2304,7 @@ void MemPool::releaseMemory(void* object, bool flagExtent) noexcept
|
||||
|
||||
block = pool->delayedFree[pool->delayedFreePos];
|
||||
object = &block->body;
|
||||
flagExtent = block->isExtent();
|
||||
|
||||
// Replace element in circular buffer
|
||||
pool->delayedFree[pool->delayedFreePos] = requested_block;
|
||||
@ -2316,6 +2322,7 @@ void MemPool::releaseMemory(void* object, bool flagExtent) noexcept
|
||||
#endif
|
||||
|
||||
// Finally delete it
|
||||
block->resetExtent();
|
||||
pool->releaseBlock(block, !flagExtent);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user