8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 08:03:03 +01:00

Better locality of allocations. This also fixes a tiny memory leak in SuperServer.

This commit is contained in:
dimitr 2011-04-05 05:15:19 +00:00
parent 0017fbcdd4
commit 811a3ba155
3 changed files with 6 additions and 5 deletions

View File

@ -999,7 +999,7 @@ static void hash_allocate(Lock* lock)
if (attachment)
{
attachment->att_compatibility_table =
vec<Lock*>::newVector(*dbb->dbb_permanent, LOCK_HASH_SIZE);
vec<Lock*>::newVector(*attachment->att_pool, LOCK_HASH_SIZE);
}
}

View File

@ -1013,7 +1013,7 @@ SLONG PAG_attachment_id(thread_db* tdbb)
// Take out lock on attachment id
Lock* lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) Lock();
Lock* lock = FB_NEW_RPT(*attachment->att_pool, sizeof(SLONG)) Lock();
attachment->att_id_lock = lock;
lock->lck_type = LCK_attachment;
lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type);
@ -2473,7 +2473,7 @@ USHORT PageManager::getTempPageSpaceID(thread_db* tdbb)
Attachment* att = tdbb->getAttachment();
if (!att->att_temp_pg_lock)
{
Lock* lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) Lock();
Lock* lock = FB_NEW_RPT(*att->att_pool, sizeof(SLONG)) Lock();
lock->lck_type = LCK_page_space;
lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type);
lock->lck_parent = dbb->dbb_lock;

View File

@ -483,6 +483,7 @@ void VIO_bump_count(thread_db* tdbb, USHORT count_id, jrd_rel* relation)
**************************************/
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
Attachment* attachment = tdbb->getAttachment();
CHECK_DBB(dbb);
#ifdef VIO_DEBUG
@ -504,9 +505,9 @@ void VIO_bump_count(thread_db* tdbb, USHORT count_id, jrd_rel* relation)
#endif
const USHORT relation_id = relation->rel_id;
vcl** ptr = tdbb->getAttachment()->att_counts + count_id;
vcl** ptr = attachment->att_counts + count_id;
vcl* vector = *ptr = vcl::newVector(*dbb->dbb_permanent, *ptr, relation_id + 1);
vcl* vector = *ptr = vcl::newVector(*attachment->att_pool, *ptr, relation_id + 1);
((*vector)[relation_id])++;
tdbb->bumpStats((RuntimeStatistics::StatType) count_id, relation_id);