mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
tweak doc a little to reduce onboarding friction for thread-users
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
import "core:prof/spall"
|
import "core:prof/spall"
|
||||||
|
import "core:sync"
|
||||||
|
|
||||||
spall_ctx: spall.Context
|
spall_ctx: spall.Context
|
||||||
spall_buffer: spall.Buffer
|
@(thread_local) spall_buffer: spall.Buffer
|
||||||
|
|
||||||
foo :: proc() {
|
foo :: proc() {
|
||||||
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
defer spall.context_destroy(&spall_ctx)
|
defer spall.context_destroy(&spall_ctx)
|
||||||
|
|
||||||
buffer_backing := make([]u8, spall.BUFFER_DEFAULT_SIZE)
|
buffer_backing := make([]u8, spall.BUFFER_DEFAULT_SIZE)
|
||||||
spall_buffer = spall.buffer_create(buffer_backing)
|
spall_buffer = spall.buffer_create(buffer_backing, sync.current_thread_id)
|
||||||
defer spall.buffer_destroy(&spall_ctx, &spall_buffer)
|
defer spall.buffer_destroy(&spall_ctx, &spall_buffer)
|
||||||
|
|
||||||
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure)
|
||||||
|
|||||||
Reference in New Issue
Block a user