log allocator: use %m to format size

This commit is contained in:
Laytan Laats
2023-12-15 23:42:59 +01:00
parent d47a403d29
commit ea709451e8

View File

@@ -39,14 +39,14 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
case .Alloc:
logf(
la.level,
"%s%s>>> ALLOCATOR(mode=.Alloc, size=%d, alignment=%d)",
"%s%s>>> ALLOCATOR(mode=.Alloc, size=%m, alignment=%d)",
la.prefix, padding, size, alignment,
location = location,
)
case .Alloc_Non_Zeroed:
logf(
la.level,
"%s%s>>> ALLOCATOR(mode=.Alloc_Non_Zeroed, size=%d, alignment=%d)",
"%s%s>>> ALLOCATOR(mode=.Alloc_Non_Zeroed, size=%m, alignment=%d)",
la.prefix, padding, size, alignment,
location = location,
)
@@ -54,7 +54,7 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
if old_size != 0 {
logf(
la.level,
"%s%s<<< ALLOCATOR(mode=.Free, ptr=%p, size=%d)",
"%s%s<<< ALLOCATOR(mode=.Free, ptr=%p, size=%m)",
la.prefix, padding, old_memory, old_size,
location = location,
)
@@ -76,7 +76,7 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
case .Resize:
logf(
la.level,
"%s%s>>> ALLOCATOR(mode=.Resize, ptr=%p, old_size=%d, size=%d, alignment=%d)",
"%s%s>>> ALLOCATOR(mode=.Resize, ptr=%p, old_size=%m, size=%m, alignment=%d)",
la.prefix, padding, old_memory, old_size, size, alignment,
location = location,
)
@@ -111,4 +111,4 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode,
}
}
return data, err
}
}