tlsf: destroy first pool & properly zero memory

This commit is contained in:
Laytan Laats
2024-06-27 19:27:07 +02:00
parent 521182a100
commit 1c199f52d6
2 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -630,7 +630,7 @@ alloc_bytes_non_zeroed :: proc(control: ^Allocator, size: uint, align: uint) ->
@(require_results)
alloc_bytes :: proc(control: ^Allocator, size: uint, align: uint) -> (res: []byte, err: runtime.Allocator_Error) {
res, err = alloc_bytes_non_zeroed(control, size, align)
if err != nil {
if err == nil {
intrinsics.mem_zero(raw_data(res), len(res))
}
return
@@ -735,4 +735,4 @@ resize_non_zeroed :: proc(control: ^Allocator, ptr: rawptr, old_size, new_size:
block_trim_used(control, block, adjust)
res = ([^]byte)(ptr)[:new_size]
return
}
}