From 45e4ce5d449f0fad58c6f527c5b926bf2d58402f Mon Sep 17 00:00:00 2001 From: Jack Punter Date: Mon, 4 Aug 2025 23:15:16 +0100 Subject: Adds @(no_instrumentation) to spall buffer and SCOPED operations Currently without this scoped event names are not displaying correctly when auto-tracing is enabled. The buffer_destroy event, obviously, fails to be completed (as theres no buffer to write the end event to, and context_destroy should happen after all the buffers are destroyed so there's, again, no buffers to write to. --- core/prof/spall/spall.odin | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/prof/spall/spall.odin b/core/prof/spall/spall.odin index 16b809359..dc53dc3dc 100644 --- a/core/prof/spall/spall.odin +++ b/core/prof/spall/spall.odin @@ -103,6 +103,7 @@ context_create_with_sleep :: proc(filename: string, sleep := 2 * time.Second) -> context_create :: proc{context_create_with_scale, context_create_with_sleep} +@(no_instrumentation) context_destroy :: proc(ctx: ^Context) { if ctx == nil { return @@ -146,6 +147,7 @@ buffer_flush :: proc "contextless" (ctx: ^Context, buffer: ^Buffer) #no_bounds_c buffer.first_ts = end } +@(no_instrumentation) buffer_destroy :: proc(ctx: ^Context, buffer: ^Buffer) { buffer_flush(ctx, buffer) @@ -155,12 +157,14 @@ buffer_destroy :: proc(ctx: ^Context, buffer: ^Buffer) { @(deferred_in=_scoped_buffer_end) +@(no_instrumentation) SCOPED_EVENT :: proc(ctx: ^Context, buffer: ^Buffer, name: string, args: string = "", location := #caller_location) -> bool { _buffer_begin(ctx, buffer, name, args, location) return true } @(private) +@(no_instrumentation) _scoped_buffer_end :: proc(ctx: ^Context, buffer: ^Buffer, _, _: string, _ := #caller_location) { _buffer_end(ctx, buffer) } -- cgit v1.2.3 From b1cda52fd6a2ef7f12c18cc8e1f2befd8350a8ce Mon Sep 17 00:00:00 2001 From: Jared Cone Date: Mon, 4 Aug 2025 19:42:23 -0700 Subject: Fixed delete-after-free in file_windows.odin --- core/os/os2/file_windows.odin | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/os/os2/file_windows.odin b/core/os/os2/file_windows.odin index 40d012183..dbac78d0e 100644 --- a/core/os/os2/file_windows.odin +++ b/core/os/os2/file_windows.odin @@ -249,9 +249,9 @@ _destroy :: proc(f: ^File_Impl) -> Error { a := f.allocator err0 := free(f.wname, a) err1 := delete(f.name, a) - err2 := free(f, a) - err3 := delete(f.r_buf, a) - err4 := delete(f.w_buf, a) + err2 := delete(f.r_buf, a) + err3 := delete(f.w_buf, a) + err4 := free(f, a) err0 or_return err1 or_return err2 or_return -- cgit v1.2.3