mem: Make stack_resize* free if size is 0

This will cause an error if the memory being resized was not the last
allocation, as should be expected according to the description that this
"acts just like stack_free."
This commit is contained in:
Feoramund
2025-06-14 07:50:30 -04:00
parent 179a8559f6
commit 79e5ddaa26
+1 -1
View File
@@ -1133,7 +1133,7 @@ stack_resize_bytes_non_zeroed :: proc(
return stack_alloc_bytes_non_zeroed(s, size, alignment, loc)
}
if size == 0 {
return nil, nil
return nil, stack_free(s, old_memory, loc)
}
start := uintptr(raw_data(s.data))
end := start + uintptr(len(s.data))