prepping to collapse Arena receiving functions to those that receive AllocatorInfo

perf impact of the indirection should be minimal, reduces code duplication.

Ideally we'd use gencpp to just have the user specify what they want, then modify which proc is avail by doing the refactors required for using either
However, it can't process execution bodies yet or expressions so thats not possible.

The other way is to just utilize _Generic to generalize the codepath so that it collapses neater but that leads to a ton of implementation getting lifted to preprocessing... so no.
This commit is contained in:
2025-02-09 11:51:50 -05:00
parent e4f797f594
commit c8cb9f3995
13 changed files with 268 additions and 63 deletions
+8
View File
@@ -39,6 +39,14 @@ void tctx_write_srcloc(char* file_name, U64 line_number);
void tctx_read_srcloc (char** file_name, U64* line_number);
#define tctx_write_this_srcloc() tctx_write_srcloc(__FILE__, __LINE__)
inline TempArena
scratch__begin_alloc(AllocatorInfo ainfo) {
Arena* arena = extract_arena(ainfo);
TempArena scratch = temp_begin(tctx_get_scratch(arena, arena != nullptr));
return scratch;
}
#define scratch_begin_alloc(ainfo) scratch__begin_alloc(ainfo)
#define scratch_begin(conflicts, count) temp_begin(tctx_get_scratch((conflicts), (count)))
#define scratch_end(scratch) temp_end(scratch)