mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-18 10:02:23 -07:00
pre-emptive thread register cache updating on ctrl thread - cache reading/updating on ui thread should always be allowed to gracefully fail, since it is literally impossible on linux, but we can always rely on the ctrl thread to pipe the right thing through eventually.
This commit is contained in:
@@ -3867,6 +3867,22 @@ ctrl_thread__entry_point(void *p)
|
||||
ins_atomic_u64_inc_eval(&ctrl_state->mem_gen);
|
||||
ins_atomic_u64_inc_eval(&ctrl_state->reg_gen);
|
||||
|
||||
//- rjf: update thread register cache
|
||||
ProfScope("update thread register cache")
|
||||
{
|
||||
CTRL_EntityCtx *entity_ctx = &ctrl_state->ctrl_thread_entity_store->ctx;
|
||||
CTRL_EntityArray threads = ctrl_entity_array_from_kind(entity_ctx, CTRL_EntityKind_Thread);
|
||||
REGS_RegBlockX64 *blocks = push_array(scratch.arena, REGS_RegBlockX64, threads.count);
|
||||
{
|
||||
for EachIndex(idx, threads.count)
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
ctrl_reg_block_from_thread(scratch.arena, entity_ctx, threads.v[idx]->handle);
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather & output logs
|
||||
ctrl_thread__end_and_flush_log();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user