mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
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:
@@ -1133,7 +1133,7 @@ stack_resize_bytes_non_zeroed :: proc(
|
|||||||
return stack_alloc_bytes_non_zeroed(s, size, alignment, loc)
|
return stack_alloc_bytes_non_zeroed(s, size, alignment, loc)
|
||||||
}
|
}
|
||||||
if size == 0 {
|
if size == 0 {
|
||||||
return nil, nil
|
return nil, stack_free(s, old_memory, loc)
|
||||||
}
|
}
|
||||||
start := uintptr(raw_data(s.data))
|
start := uintptr(raw_data(s.data))
|
||||||
end := start + uintptr(len(s.data))
|
end := start + uintptr(len(s.data))
|
||||||
|
|||||||
Reference in New Issue
Block a user