mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
name tag arenas for the memory plots
This commit is contained in:
@@ -17,10 +17,19 @@ C_LINKAGE thread_static TCTX *tctx_thread_local = 0;
|
|||||||
internal TCTX *
|
internal TCTX *
|
||||||
tctx_alloc(void)
|
tctx_alloc(void)
|
||||||
{
|
{
|
||||||
Arena *arena = arena_alloc();
|
#if PROFILE_TELEMETRY
|
||||||
TCTX *tctx = push_array(arena, TCTX, 1);
|
thread_static static U8 name[2][1024];
|
||||||
tctx->arenas[0] = arena;
|
raddbg_snprintf(name[0], sizeof(name[0]), "Scratch/0[TID:%u]", os_tid());
|
||||||
tctx->arenas[1] = arena_alloc();
|
raddbg_snprintf(name[1], sizeof(name[1]), "Scratch/1[TID:%u]", os_tid());
|
||||||
|
Arena *arena_0 = arena_alloc(.name = name[0]);
|
||||||
|
Arena *arena_1 = arena_alloc(.name = name[1]);
|
||||||
|
#else
|
||||||
|
Arena *arena_0 = arena_alloc();
|
||||||
|
Arena *arena_1 = arena_alloc();
|
||||||
|
#endif
|
||||||
|
TCTX *tctx = push_array(arena_0, TCTX, 1);
|
||||||
|
tctx->arenas[0] = arena_0;
|
||||||
|
tctx->arenas[1] = arena_1;
|
||||||
tctx->lane_ctx.lane_count = 1;
|
tctx->lane_ctx.lane_count = 1;
|
||||||
return tctx;
|
return tctx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
internal COFF_ObjWriter*
|
internal COFF_ObjWriter*
|
||||||
coff_obj_writer_alloc(COFF_TimeStamp time_stamp, COFF_MachineType machine)
|
coff_obj_writer_alloc(COFF_TimeStamp time_stamp, COFF_MachineType machine)
|
||||||
{
|
{
|
||||||
Arena *arena = arena_alloc();
|
Arena *arena = arena_alloc(.name = "COFF OBJ WRITER");
|
||||||
COFF_ObjWriter *obj_writer = push_array(arena, COFF_ObjWriter, 1);
|
COFF_ObjWriter *obj_writer = push_array(arena, COFF_ObjWriter, 1);
|
||||||
obj_writer->arena = arena;
|
obj_writer->arena = arena;
|
||||||
obj_writer->time_stamp = time_stamp;
|
obj_writer->time_stamp = time_stamp;
|
||||||
|
|||||||
+2
-2
@@ -958,7 +958,7 @@ lnk_array_from_input_list(Arena *arena, LNK_InputList list)
|
|||||||
internal LNK_Inputer *
|
internal LNK_Inputer *
|
||||||
lnk_inputer_init(void)
|
lnk_inputer_init(void)
|
||||||
{
|
{
|
||||||
Arena *arena = arena_alloc();
|
Arena *arena = arena_alloc(.name = "INPUTER");
|
||||||
LNK_Inputer *inputer = push_array(arena, LNK_Inputer, 1);
|
LNK_Inputer *inputer = push_array(arena, LNK_Inputer, 1);
|
||||||
inputer->arena = arena;
|
inputer->arena = arena;
|
||||||
inputer->objs_ht = hash_table_init(arena, 0x20000);
|
inputer->objs_ht = hash_table_init(arena, 0x20000);
|
||||||
@@ -1748,7 +1748,7 @@ lnk_link_image(TP_Context *tp, TP_Arena *arena, LNK_Config *config, LNK_Inputer
|
|||||||
// init link context
|
// init link context
|
||||||
//
|
//
|
||||||
LNK_Link *link = push_array(arena->v[0], LNK_Link, 1);
|
LNK_Link *link = push_array(arena->v[0], LNK_Link, 1);
|
||||||
link->arena = arena_alloc();
|
link->arena = arena_alloc(.name = "LINK");
|
||||||
link->last_symbol_input = &link->objs.first;
|
link->last_symbol_input = &link->objs.first;
|
||||||
link->last_include = &config->include_symbol_list.first;
|
link->last_include = &config->include_symbol_list.first;
|
||||||
link->last_default_lib = &config->input_default_lib_list.first;
|
link->last_default_lib = &config->input_default_lib_list.first;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ tp_arena_alloc(TP_Context *pool)
|
|||||||
Temp scratch = scratch_begin(0,0);
|
Temp scratch = scratch_begin(0,0);
|
||||||
Arena **arr = push_array(scratch.arena, Arena *, pool->worker_count);
|
Arena **arr = push_array(scratch.arena, Arena *, pool->worker_count);
|
||||||
for (U64 i = 0; i < pool->worker_count; ++i) {
|
for (U64 i = 0; i < pool->worker_count; ++i) {
|
||||||
arr[i] = arena_alloc();
|
arr[i] = arena_alloc("THREAD_POOL");
|
||||||
}
|
}
|
||||||
Arena **dst = push_array(arr[0], Arena *, pool->worker_count);
|
Arena **dst = push_array(arr[0], Arena *, pool->worker_count);
|
||||||
MemoryCopy(dst, arr, sizeof(Arena*) * pool->worker_count);
|
MemoryCopy(dst, arr, sizeof(Arena*) * pool->worker_count);
|
||||||
|
|||||||
Reference in New Issue
Block a user