its compiling... (prepping for runtime testing)

This commit is contained in:
ed
2025-02-08 23:27:06 -05:00
parent 3b12268f46
commit 50c7853b9f
15 changed files with 138 additions and 54 deletions
+18
View File
@@ -5,6 +5,24 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
// Context
void init(Context* ctx)
{
if (ctx->backing[0].proc != nullptr) {
tctx_init_and_equip_alloc(& ctx->thread_ctx, ctx->backing[0]);
}
else {
tctx_init_and_equip(& ctx->thread_ctx);
}
}
void deinit(Context* ctx)
{
tctx_release();
}
////////////////////////////////
//~ rjf: Message Type Functions
+22
View File
@@ -221,6 +221,22 @@ struct ParseResult
MsgList msgs;
};
////////////////////////////////
// Context
typedef struct Context Context;
struct Context
{
// Note: Only used so far as the first fallback if the user did not preset the thread_context's arenas
// Otherwise it will just reserve its own Arena backed by chained virutal address space
AllocatorInfo backing[2];
// Its recommended that the user hooks up
// their own arena allocators to the thread context
// which will be utilized for thread local scratch arena
TCTX thread_ctx;
};
////////////////////////////////
//~ rjf: Globals
@@ -241,6 +257,12 @@ nil_node()
return &nil;
}
////////////////////////////////
// Context lifetime Functios
MD_API void init (Context* ctx);
MD_API void deinit(Context* ctx);
////////////////////////////////
//~ rjf: Message Type Functions