8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:43:04 +01:00

Use relation pool for data page phys numbers map.

It makes impossible to use batch allocation of RelationPages instances for GTT's but it is not important until metadata cache is not shared.
This commit is contained in:
hvlad 2016-11-10 16:29:31 +02:00
parent c14bb65ce0
commit ca3c9b7893
2 changed files with 9 additions and 17 deletions

View File

@ -73,16 +73,8 @@ RelationPages* jrd_rel::getPagesInternal(thread_db* tdbb, TraNumber tran, bool a
return 0;
RelationPages* newPages = rel_pages_free;
if (!newPages)
{
const size_t BULK_ALLOC = 8;
RelationPages* allocatedPages = newPages =
FB_NEW_POOL(*rel_pool) RelationPages[BULK_ALLOC];
rel_pages_free = ++allocatedPages;
for (size_t i = 1; i < BULK_ALLOC - 1; i++, allocatedPages++)
allocatedPages->rel_next_free = allocatedPages + 1;
if (!newPages) {
newPages = FB_NEW_POOL(*rel_pool) RelationPages(*rel_pool);
}
else
{

View File

@ -86,14 +86,14 @@ public:
ULONG rel_last_free_pri_dp; // last primary data page found with space
USHORT rel_pg_space_id;
RelationPages()
RelationPages(Firebird::MemoryPool& pool)
: rel_pages(NULL), rel_instance_id(0),
rel_index_root(0), rel_data_pages(0), rel_slot_space(0),
rel_pri_data_space(0), rel_sec_data_space(0),
rel_last_free_pri_dp(0),
rel_pg_space_id(DB_PAGE_SPACE), rel_next_free(NULL),
useCount(0),
dpMap(*getDefaultMemoryPool()),
dpMap(pool),
dpMapMark(0)
{}
@ -273,12 +273,12 @@ public:
return &rel_pages_base;
}
bool delPages(thread_db* tdbb, TraNumber tran = MAX_TRA_NUMBER, RelationPages* aPages = NULL);
bool delPages(thread_db* tdbb, TraNumber tran = MAX_TRA_NUMBER, RelationPages* aPages = NULL);
void getRelLockKey(thread_db* tdbb, UCHAR* key);
USHORT getRelLockKeyLength() const;
void getRelLockKey(thread_db* tdbb, UCHAR* key);
USHORT getRelLockKeyLength() const;
void cleanUp();
void cleanUp();
class RelPagesSnapshot : public Firebird::Array<RelationPages*>
{
@ -398,7 +398,7 @@ const ULONG REL_gc_lockneed = 0x80000; // gc lock should be acquired
inline jrd_rel::jrd_rel(MemoryPool& p)
: rel_pool(&p), rel_flags(REL_gc_lockneed),
rel_name(p), rel_owner_name(p), rel_security_name(p),
rel_view_contexts(p), rel_gc_records(p)
rel_view_contexts(p), rel_gc_records(p), rel_pages_base(p)
{
}