diff options
Diffstat (limited to 'src/common_memory.cpp')
| -rw-r--r-- | src/common_memory.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common_memory.cpp b/src/common_memory.cpp index 63b7c24ef..c8a62756a 100644 --- a/src/common_memory.cpp +++ b/src/common_memory.cpp @@ -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) { |