finished collaping arena->allocator info code paths

This commit is contained in:
2025-02-10 01:43:33 -05:00
parent fd44c53e57
commit a54d309fbf
10 changed files with 228 additions and 326 deletions
+2 -2
View File
@@ -71,7 +71,7 @@ UNRESOLVED_GENERIC_SELECTION const assert_generic_selection_fail = {0};
// ----------------------------------------------------------------------------------------------------------------------------------
// Then each definiton of a function has an associated define:
#// #define GENERIC_SLOT_<#>_<generic identifier> <typename>, <function_to_resolve>
// #define GENERIC_SLOT_<#>_<generic identifier> <typename>, <function_to_resolve>
// Then somehwere later on
// <etc> <return_type> <function_id> ( <arguments> ) { <implementation> }
@@ -129,8 +129,8 @@ size_t example_hash__P_long_long( long long val ) { return val * 2654435761ull;
#ifndef type_to_expression
// Used to keep the _Generic keyword happy as bare types are not considered "expressions"
#define type_to_expression(type) (* (type*)NULL)
#endif
// Instead of using this macro, it should be directly expanded by code generation.
#endif
// _Generic also suffers from type compability flatting distinctions between typedef by resolving the selection to the underling type and qualifier.
// To resolve this these distinctions must be enforced using structs that enforce the typedef
+5 -1
View File
@@ -889,6 +889,11 @@ MD_API OperatingSystem operating_system_from_string(String8 string);
////////////////////////////////
//~ rjf: Basic Types & Space Enum -> String Conversions
String8 string_from_dimension (Dimension dimension);
String8 string_from_side (Side side);
String8 string_from_operating_system(OperatingSystem os);
String8 string_from_architecture (Arch arch);
inline String8
string_from_dimension(Dimension dimension) {
local_persist String8 strings[] = {
@@ -1172,7 +1177,6 @@ MD_API void str8_serial_push_u32__ainfo (AllocatorInfo ainfo, String8Lis
#define str8_serial_push_cstr(allocator, srl, str) _Generic(allocator, Arena*: str8_serial_push_cstr__arena, AllocatorInfo: str8_serial_push_cstr__ainfo, default: assert_generic_selection_fail) resolved_function_call(allocator, srl, str)
#define str8_serial_push_string(allocator, slr, str) _Generic(allocator, Arena*: str8_serial_push_string__arena, AllocatorInfo: str8_serial_push_string__ainfo, default: assert_generic_selection_fail) resolved_function_call(allocator, srl, str)
force_inline U64 str8_serial_push_align__arena(Arena* arena, String8List* srl, U64 align) { return str8_serial_push_align__ainfo(arena_allocator(arena), srl, align); }
force_inline void* str8_serial_push_size__arena (Arena* arena, String8List* srl, U64 size) { return str8_serial_push_size__ainfo (arena_allocator(arena), srl, size); }
force_inline void str8_serial_push_u64__arena (Arena* arena, String8List* srl, U64 x) { str8_serial_push_u64__ainfo (arena_allocator(arena), srl, x); }