Update delete to pass size in bytes to free when possible

This commit is contained in:
gingerBill
2022-08-08 15:16:18 +01:00
parent 60aeab3c38
commit 659c3c528d
3 changed files with 34 additions and 10 deletions
+15 -6
View File
@@ -36,12 +36,21 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
location = location,
)
case .Free:
logf(
level=la.level,
fmt_str = "%s%s<<< ALLOCATOR(mode=.Free, ptr=%p, size=%d)",
args = {la.prefix, " " if la.prefix != "" else "", old_memory, old_size},
location = location,
)
if old_size != 0 {
logf(
level=la.level,
fmt_str = "%s%s<<< ALLOCATOR(mode=.Free, ptr=%p, size=%d)",
args = {la.prefix, " " if la.prefix != "" else "", old_memory, old_size},
location = location,
)
} else {
logf(
level=la.level,
fmt_str = "%s%s<<< ALLOCATOR(mode=.Free, ptr=%p)",
args = {la.prefix, " " if la.prefix != "" else "", old_memory},
location = location,
)
}
case .Free_All:
logf(
level=la.level,