messing around with testing using keyword in proc args (with new debug support)

This commit is contained in:
2025-07-19 00:07:36 -04:00
parent fe8e84f9bd
commit 3769413a50
8 changed files with 31 additions and 32 deletions

View File

@ -12,30 +12,26 @@ SpallProfiler :: struct {
buffer : spall.Buffer,
}
// The rest is a snippet to implement in the target codebase.
when false
{
@(private)
Module_Context : ^SpallProfiler
@(private)
Module_Context : ^SpallProfiler
set_profiler_module_context :: #force_inline proc "contextless" ( ctx : ^SpallProfiler ) {
Module_Context = ctx
}
set_profiler_module_context :: #force_inline proc "contextless" ( ctx : ^SpallProfiler ) {
Module_Context = ctx
}
DISABLE_PROFILING :: true
DISABLE_PROFILING :: true
@(deferred_none = profile_end, disabled = DISABLE_PROFILING)
profile :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( & Module_Context.ctx, & Module_Context.buffer, name, "", loc )
}
@(deferred_none = profile_end, disabled = DISABLE_PROFILING)
profile :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( & Module_Context.ctx, & Module_Context.buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_begin :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( & Module_Context.ctx, & Module_Context.buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_begin :: #force_inline proc "contextless" ( name : string, loc := #caller_location ) {
spall._buffer_begin( & Module_Context.ctx, & Module_Context.buffer, name, "", loc )
}
@(disabled = DISABLE_PROFILING)
profile_end :: #force_inline proc "contextless" () {
spall._buffer_end( & Module_Context.ctx, & Module_Context.buffer)
}
}
@(disabled = DISABLE_PROFILING)
profile_end :: #force_inline proc "contextless" () {
spall._buffer_end( & Module_Context.ctx, & Module_Context.buffer)
}

View File

@ -114,6 +114,7 @@ RuntimeState :: struct {
@thread_local
worker_thread: sectr.ThreadWorkerContext
// TODO(Ed): Only persisent needs to be allocated by the host.
ClientMemory :: struct {
persistent : VArena,
frame : VArena,
@ -279,6 +280,8 @@ sync_sectr_api :: proc( sectr_api : ^sectr.ModuleAPI, memory : ^ClientMemory, lo
}
}
// TODO(Ed): Put data segment memory in a Host_DataSegment struct.
fmt_backing : [16 * Kilobyte] u8
persistent_backing : [32 * Megabyte] byte

View File

@ -0,0 +1 @@
package sectr

View File

@ -20,10 +20,10 @@ Job :: struct {
next: ^Job,
cb: JobProc,
data: rawptr,
// scratch: ^CArena,
group: ^JobGroup,
ignored: IgnoredThreads,
dbg_lbl: string,
// scratch: CArena,
}
JobList :: struct {
@ -43,7 +43,7 @@ JobSystemContext :: struct {
ThreadWorkerContext :: struct {
system_ctx: Thread,
index: int,
}
}
WorkerID :: enum u32 {
Master_Prepper = 0,

View File

@ -1,3 +0,0 @@
package sectr

View File

@ -40,7 +40,7 @@ Memory :: struct {
state : ^State,
replay : ReplayState,
replay : ReplayState, // TODO(Ed): Were not doing it this way.
logger : Logger,
profiler : ^SpallProfiler
}
@ -182,7 +182,7 @@ State :: struct {
transient_clear_time : f32, // Time in seconds for the usual period to clear transient
transient_clear_elapsed : f32, // Time since last clear
job_system : JobSystemContext,
job_system : ^JobSystemContext,
string_cache : StringCache,

View File

@ -69,14 +69,14 @@ append_staged_input_events :: #force_inline proc( event : InputEvent ) {
append( & state.staged_input_events, event )
}
pull_staged_input_events :: proc( input : ^InputState, input_events : ^InputEvents, staged_events : Array(InputEvent) )
pull_staged_input_events :: proc( input : ^InputState, using input_events : ^InputEvents, using staged_events : Array(InputEvent) )
{
// TODO(Ed) : Add guards for multi-threading
staged_events_slice := array_to_slice(staged_events)
push( & input_events.events, staged_events_slice )
using input_events
// using input_events
for event in staged_events_slice
{