eliminate separate chunk list for location cases

This commit is contained in:
Ryan Fleury
2025-09-05 15:19:30 -07:00
parent fa05bbf2a5
commit cc9f45299a
6 changed files with 28 additions and 101 deletions
+4 -24
View File
@@ -1007,26 +1007,6 @@ rdim_location_chunk_list_concat_in_place(RDIM_LocationChunkList *dst, RDIM_Locat
RDIM_IdxedChunkListConcatInPlace(RDIM_LocationChunkNode, dst, to_push, dst->total_encoded_size += to_push->total_encoded_size);
}
RDI_PROC RDIM_LocationCase2 *
rdim_location_case_chunk_list_push(RDIM_Arena *arena, RDIM_LocationCaseChunkList *list, RDI_U64 cap)
{
RDIM_IdxedChunkListPush(arena, list, RDIM_LocationCaseChunkNode, RDIM_LocationCase2, cap, result);
return result;
}
RDI_PROC RDI_U64
rdim_idx_from_location_case(RDIM_LocationCase2 *location_case)
{
RDIM_IdxedChunkListElementGetIdx(location_case, idx);
return idx;
}
RDI_PROC void
rdim_location_case_chunk_list_concat_in_place(RDIM_LocationCaseChunkList *dst, RDIM_LocationCaseChunkList *to_push)
{
RDIM_IdxedChunkListConcatInPlace(RDIM_LocationCaseChunkNode, dst, to_push);
}
////////////////////////////////
//~ rjf: [Building] Scope Info Building
@@ -1050,9 +1030,9 @@ RDI_PROC void
rdim_scope_chunk_list_concat_in_place(RDIM_ScopeChunkList *dst, RDIM_ScopeChunkList *to_push)
{
RDIM_IdxedChunkListConcatInPlace(RDIM_ScopeChunkNode, dst, to_push,
dst->scope_voff_count += to_push->scope_voff_count,
dst->local_count += to_push->local_count,
dst->location_count += to_push->location_count);
dst->scope_voff_count += to_push->scope_voff_count,
dst->local_count += to_push->local_count,
dst->location_case_count += to_push->location_case_count);
}
RDI_PROC void
@@ -1214,7 +1194,7 @@ rdim_location_set_push_case(RDIM_Arena *arena, RDIM_ScopeChunkList *scopes, RDIM
locset->location_case_count += 1;
location_case->voff_range = voff_range;
location_case->location = location;
scopes->location_count +=1;
scopes->location_case_count +=1;
}
//- rjf:location block chunk list
+2 -26
View File
@@ -848,30 +848,11 @@ struct RDIM_LocationChunkList
typedef struct RDIM_LocationCase2 RDIM_LocationCase2;
struct RDIM_LocationCase2
{
struct RDIM_LocationCaseChunkNode *chunk;
RDIM_LocationCase2 *next;
RDIM_Location2 *location;
RDIM_Rng1U64 voff_range;
};
typedef struct RDIM_LocationCaseChunkNode RDIM_LocationCaseChunkNode;
struct RDIM_LocationCaseChunkNode
{
RDIM_LocationCaseChunkNode *next;
RDIM_LocationCase2 *v;
RDI_U64 count;
RDI_U64 cap;
RDI_U64 base_idx;
};
typedef struct RDIM_LocationCaseChunkList RDIM_LocationCaseChunkList;
struct RDIM_LocationCaseChunkList
{
RDIM_LocationCaseChunkNode *first;
RDIM_LocationCaseChunkNode *last;
RDI_U64 chunk_count;
RDI_U64 total_count;
};
//- rjf: locations (OLD)
typedef struct RDIM_Location RDIM_Location;
@@ -1022,7 +1003,7 @@ struct RDIM_ScopeChunkList
RDI_U64 total_count;
RDI_U64 scope_voff_count;
RDI_U64 local_count;
RDI_U64 location_count;
RDI_U64 location_case_count;
};
////////////////////////////////
@@ -1041,7 +1022,6 @@ struct RDIM_BakeParams
RDIM_SrcFileChunkList src_files;
RDIM_LineTableChunkList line_tables;
RDIM_LocationChunkList locations;
RDIM_LocationCaseChunkList location_cases;
RDIM_SymbolChunkList global_variables;
RDIM_SymbolChunkList thread_variables;
RDIM_SymbolChunkList constants;
@@ -1707,10 +1687,6 @@ RDI_PROC RDI_U64 rdim_idx_from_location(RDIM_Location2 *location);
RDI_PROC RDI_U64 rdim_off_from_location(RDIM_Location2 *location);
RDI_PROC void rdim_location_chunk_list_concat_in_place(RDIM_LocationChunkList *dst, RDIM_LocationChunkList *to_push);
RDI_PROC RDIM_LocationCase2 *rdim_location_case_chunk_list_push(RDIM_Arena *arena, RDIM_LocationCaseChunkList *list, RDI_U64 cap);
RDI_PROC RDI_U64 rdim_idx_from_location_case(RDIM_LocationCase2 *location_case);
RDI_PROC void rdim_location_case_chunk_list_concat_in_place(RDIM_LocationCaseChunkList *dst, RDIM_LocationCaseChunkList *to_push);
////////////////////////////////
//~ rjf: [Building] Scope Info Building