diff options
| author | Colin Davidson <colrdavidson@gmail.com> | 2024-07-28 01:23:47 -0700 |
|---|---|---|
| committer | Colin Davidson <colrdavidson@gmail.com> | 2024-07-28 01:23:47 -0700 |
| commit | 1d598f82873ca0519b79e8e36f79d7ef86bf85ab (patch) | |
| tree | b119ac234591ba6b879e6b6b97c0ffa78322a8bd /core/prof | |
| parent | cb31df34c199638a03193520e03a59fc722429d2 (diff) | |
tweak doc a little to reduce onboarding friction for thread-users
Diffstat (limited to 'core/prof')
| -rw-r--r-- | core/prof/spall/doc.odin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/prof/spall/doc.odin b/core/prof/spall/doc.odin index c34ba0d5b..479ee7e46 100644 --- a/core/prof/spall/doc.odin +++ b/core/prof/spall/doc.odin @@ -1,8 +1,9 @@ /* import "core:prof/spall" + import "core:sync" spall_ctx: spall.Context - spall_buffer: spall.Buffer + @(thread_local) spall_buffer: spall.Buffer foo :: proc() { spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure) @@ -13,7 +14,7 @@ defer spall.context_destroy(&spall_ctx) 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) spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure) |