mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 04:43:03 +01:00
Better locality of allocations. This also fixes a tiny memory leak in SuperServer.
This commit is contained in:
parent
0017fbcdd4
commit
811a3ba155
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user