Merge pull request #4148 from Feoramund/tls-cleaner

Add API for freeing `thread_local` state
This commit is contained in:
gingerBill authored and GitHub committed 2024-08-26 22:37:08 +01:00
commit 91f8c626bb
4 files changed
+49 -2

No files matched your search

+5
View File
@@ -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)
}