LibC: Fix malloc mmap byte tracking

I was incrementing instead of decrementing when freeing mmap allocs
This commit is contained in:
2026-07-20 06:58:30 +03:00
parent 64523b6c70
commit 7f25350c62
+1 -1
View File
@@ -305,7 +305,7 @@ void free(void* ptr)
const auto& header = static_cast<MmapAllocationHeader*>(ptr)[-1]; const auto& header = static_cast<MmapAllocationHeader*>(ptr)[-1];
s_mmap_count--; s_mmap_count--;
s_mmap_bytes += header.mmap_size; s_mmap_bytes -= header.mmap_size;
munmap(static_cast<uint8_t*>(ptr) - header.offset, header.mmap_size); munmap(static_cast<uint8_t*>(ptr) - header.offset, header.mmap_size);
} }