mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Better locality of allocations. This also fixes a tiny memory leak in SuperServer.
This commit is contained in:
parent
d2a15f62a0
commit
4b3033c013
@ -989,13 +989,13 @@ static void hash_allocate(Lock* lock)
|
||||
**************************************/
|
||||
fb_assert(LCK_CHECK_LOCK(lock));
|
||||
|
||||
Database* dbb = lock->lck_dbb;
|
||||
Database* const dbb = lock->lck_dbb;
|
||||
Jrd::Attachment* const attachment = lock->lck_attachment;
|
||||
|
||||
Jrd::Attachment* attachment = lock->lck_attachment;
|
||||
if (attachment)
|
||||
{
|
||||
attachment->att_compatibility_table =
|
||||
vec<Lock*>::newVector(*dbb->dbb_permanent, LOCK_HASH_SIZE);
|
||||
vec<Lock*>::newVector(*attachment->att_pool, LOCK_HASH_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -762,7 +762,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* const 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);
|
||||
@ -2180,11 +2180,11 @@ USHORT PageManager::getTempPageSpaceID(thread_db* tdbb)
|
||||
if (Config::getSharedDatabase())
|
||||
{
|
||||
SET_TDBB(tdbb);
|
||||
Database* dbb = tdbb->getDatabase();
|
||||
Jrd::Attachment* att = tdbb->getAttachment();
|
||||
if (!att->att_temp_pg_lock)
|
||||
Database* const dbb = tdbb->getDatabase();
|
||||
Jrd::Attachment* const attachment = tdbb->getAttachment();
|
||||
if (!attachment->att_temp_pg_lock)
|
||||
{
|
||||
Lock* lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) Lock();
|
||||
Lock* lock = FB_NEW_RPT(*attachment->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;
|
||||
@ -2202,10 +2202,10 @@ USHORT PageManager::getTempPageSpaceID(thread_db* tdbb)
|
||||
fb_utils::init_status(tdbb->tdbb_status_vector);
|
||||
}
|
||||
|
||||
att->att_temp_pg_lock = lock;
|
||||
attachment->att_temp_pg_lock = lock;
|
||||
}
|
||||
|
||||
result = (USHORT) att->att_temp_pg_lock->lck_key.lck_long;
|
||||
result = (USHORT) attachment->att_temp_pg_lock->lck_key.lck_long;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -494,7 +494,8 @@ void VIO_bump_count(thread_db* tdbb, USHORT count_id, jrd_rel* relation)
|
||||
*
|
||||
**************************************/
|
||||
SET_TDBB(tdbb);
|
||||
Database* dbb = tdbb->getDatabase();
|
||||
Database* const dbb = tdbb->getDatabase();
|
||||
Jrd::Attachment* const attachment = tdbb->getAttachment();
|
||||
CHECK_DBB(dbb);
|
||||
|
||||
#ifdef VIO_DEBUG
|
||||
@ -516,9 +517,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