From 49606ec3ea532fc7ee5a89c0a386d995e30e70e5 Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Mon, 26 Aug 2024 05:59:41 -0400 Subject: [PATCH] Use `thread_local_cleaner` API in `os2` --- core/os/os2/allocators.odin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/os/os2/allocators.odin b/core/os/os2/allocators.odin index 0ab3adfb2..ddfe230be 100644 --- a/core/os/os2/allocators.odin +++ b/core/os/os2/allocators.odin @@ -61,3 +61,8 @@ TEMP_ALLOCATOR_GUARD :: #force_inline proc(loc := #caller_location) -> (runtime. global_default_temp_allocator_index = (global_default_temp_allocator_index+1)%MAX_TEMP_ARENA_COUNT return tmp, loc } + +@(init, private) +init_thread_local_cleaner :: proc() { + runtime.add_thread_local_cleaner(temp_allocator_fini) +}