first pass at (rdi -> loose rdim) path, used in (rdi * ... * rdi) -> rdi joining in radbin; plug in regular conversion path before voff -> line & breakpad paths in radbin, such that PDBs, DWARFs, RDIs, etc. can be used as input; fix up voff -> line path to plug into regular output systems; remove String8 union thing - three reasons: (a) it was only ever introduced for convenience in Linux layers, so let's just keep zero-terminated Linux nonsense in Linux land, (b) it was just alternate syntax for a cast, so let's just cast, (c) it was misleading - 'cstr' implies null-termination, which String8 of course doesn't guarantee. this led to some misuses, where .cstr was trusted to be zero-terminated, when that was not necessarily true (semaphore opening).

This commit is contained in:
Ryan Fleury
2026-03-03 16:24:54 -08:00
parent 2af3990971
commit 4312ee14fd
17 changed files with 1797 additions and 1508 deletions
+41 -41
View File
@@ -5,51 +5,51 @@
//~ rjf: API Implementation Helper Macros
#define RDIM_IdxedChunkListPush(arena, list, chunk_type, element_type, cap_value, result, ...) \
element_type *result = 0; \
do \
{ \
chunk_type *n = list->last; \
if(n == 0 || n->count >= n->cap) \
{ \
n = rdim_push_array(arena, chunk_type, 1); \
n->cap = cap_value; \
n->base_idx = list->total_count; \
__VA_ARGS__; \
n->v = rdim_push_array_no_zero(arena, element_type, n->cap); \
RDIM_SLLQueuePush(list->first, list->last, n); \
list->chunk_count += 1; \
} \
result = &n->v[n->count]; \
result->chunk = n; \
n->count += 1; \
list->total_count += 1; \
}while(0)
element_type *result = 0; \
do \
{ \
chunk_type *n = list->last; \
if(n == 0 || n->count >= n->cap) \
{ \
n = rdim_push_array(arena, chunk_type, 1); \
n->cap = cap_value; \
n->base_idx = list->total_count; \
__VA_ARGS__; \
n->v = rdim_push_array_no_zero(arena, element_type, n->cap); \
RDIM_SLLQueuePush(list->first, list->last, n); \
list->chunk_count += 1; \
} \
result = &n->v[n->count]; \
result->chunk = n; \
n->count += 1; \
list->total_count += 1; \
}while(0)
#define RDIM_IdxedChunkListElementGetIdx(ptr, result) \
RDI_U64 idx = 0; \
if(ptr != 0 && ptr->chunk != 0) \
{ \
idx = ptr->chunk->base_idx + (ptr - ptr->chunk->v) + 1; \
}
RDI_U64 idx = 0; \
if(ptr != 0 && ptr->chunk != 0) \
{ \
idx = ptr->chunk->base_idx + (ptr - ptr->chunk->v) + 1; \
}
#define RDIM_IdxedChunkListConcatInPlace(chunk_type, dst, to_push, ...) \
for(chunk_type *n = to_push->first; n != 0; n = n->next) \
{ \
n->base_idx += dst->total_count; \
} \
if(dst->last != 0 && to_push->first != 0) \
{ \
dst->last->next = to_push->first; \
dst->last = to_push->last; \
dst->chunk_count += to_push->chunk_count; \
dst->total_count += to_push->total_count; \
__VA_ARGS__; \
} \
else if(dst->first == 0) \
{ \
rdim_memcpy_struct(dst, to_push); \
} \
rdim_memzero_struct(to_push);
for(chunk_type *n = to_push->first; n != 0; n = n->next) \
{ \
n->base_idx += dst->total_count; \
} \
if(dst->last != 0 && to_push->first != 0) \
{ \
dst->last->next = to_push->first; \
dst->last = to_push->last; \
dst->chunk_count += to_push->chunk_count; \
dst->total_count += to_push->total_count; \
__VA_ARGS__; \
} \
else if(dst->first == 0) \
{ \
rdim_memcpy_struct(dst, to_push); \
} \
rdim_memzero_struct(to_push);
////////////////////////////////
//~ rjf: Basic Helpers
+5
View File
@@ -1757,4 +1757,9 @@ RDI_PROC RDIM_SerializedSection rdim_serialized_section_make_unpacked(void *data
RDI_PROC RDIM_SerializedSectionBundle rdim_serialized_section_bundle_from_bake_results(RDIM_BakeResults *results);
RDI_PROC RDIM_String8List rdim_file_blobs_from_section_bundle(RDIM_Arena *arena, RDIM_SerializedSectionBundle *bundle);
////////////////////////////////
//~ rjf: [Serializing] Parsed RDI -> Bake Results
RDI_PROC RDIM_BakeResults *rdim_bake_results_from_rdi(RDIM_Arena *arena, RDI_Parsed *rdi);
#endif // RDI_MAKE_H