Skip to content

Commit 72aaa85

Browse files
committed
Fixes to MetaCScopeTable ExtraMemberSize calculation and reduced the default size
1 parent 9ae61c0 commit 72aaa85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

semantic/metac_scope.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void MetaCScopeTable_InitN(metac_scope_table_t* self, uint32_t nMembers, metac_a
1414
{
1515
// we need to avoid the table being 100% full
1616
// so allocate 25% more than needed.
17-
uint32_t extraMembers = (nMembers > 16) ? 8 : (nMembers >> 2);
17+
uint32_t extraMembers = ((nMembers < 16) ? 4 : (nMembers >> 2));
1818
tagged_arena_t* arena = 0;
1919
const uint32_t slotsLog2 = LOG2(nMembers + extraMembers);
2020
const uint32_t maxSlots = (1 << slotsLog2);
@@ -31,7 +31,7 @@ void MetaCScopeTable_InitN(metac_scope_table_t* self, uint32_t nMembers, metac_a
3131

3232
void MetaCScopeTable_Init(metac_scope_table_t* self, metac_alloc_t* alloc)
3333
{
34-
MetaCScopeTable_InitN(self, 32, alloc);
34+
MetaCScopeTable_InitN(self, 24, alloc);
3535
}
3636

3737
void MetaCScopeTable_Free(metac_scope_table_t* self)
@@ -74,7 +74,7 @@ metac_scope_table_slot_t* MetaCScopeTable_Lookup(metac_scope_table_t* self,
7474
return 0;
7575
}
7676
#define existsPointer ((metac_scope_table_slot_t*) 2)
77-
#define fullPointer ((metac_scope_table_slot_t*) 1)
77+
#define fullPointer ((metac_scope_table_slot_t*) 3)
7878

7979
metac_scope_table_slot_t* MetaCScopeTable_Insert(metac_scope_table_t* self,
8080
metac_identifier_ptr_t idPtr)

0 commit comments

Comments
 (0)