mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-14 06:24:19 -04:00
Use fetch_add rather than +=
This commit is contained in:
1 parent
e27046098b
commit
2a8fa8612d
2 files changed
+3
-3
No files matched your search
@@ -165,11 +165,11 @@ gb_internal void platform_virtual_memory_protect(void *memory, isize size);
|
||||
gb_printf_err("Total Usage: %lld bytes\n", cast(long long)global_platform_memory_total_usage);
|
||||
GB_ASSERT_MSG(pmblock != nullptr, "Out of Virtual Memory, oh no...");
|
||||
}
|
||||
global_platform_memory_total_usage += total_size;
|
||||
global_platform_memory_total_usage.fetch_add(total_size);
|
||||
return pmblock;
|
||||
}
|
||||
gb_internal void platform_virtual_memory_free(PlatformMemoryBlock *block) {
|
||||
global_platform_memory_total_usage -= block->total_size;
|
||||
global_platform_memory_total_usage.fetch_sub(block->total_size);
|
||||
GB_ASSERT(VirtualFree(block, 0, MEM_RELEASE));
|
||||
}
|
||||
gb_internal void platform_virtual_memory_protect(void *memory, isize size) {
|
||||
|
||||
Reference in new issue
Block a user