aboutsummaryrefslogtreecommitdiff
path: root/core/mem
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-06-14 07:50:30 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-06-14 13:21:14 -0400
commit79e5ddaa265099f0e68040160a8e021248473e95 (patch)
treea49af13fcd9cc2441e5be6c291d525d51ad32090 /core/mem
parent179a8559f6e8165e22430034ff24484f7da0de3c (diff)
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."
Diffstat (limited to 'core/mem')
-rw-r--r--core/mem/allocators.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin
index 35d5a39ce..4002f6b17 100644
--- a/core/mem/allocators.odin
+++ b/core/mem/allocators.odin
@@ -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))