[mem]: Fix handling of default resize to check alignment

This commit is contained in:
flysand7
2024-09-11 08:00:27 +11:00
parent fdd4882568
commit f16ed256ea
3 changed files with 19 additions and 5 deletions
+1 -1
View File
@@ -1096,7 +1096,7 @@ _default_resize_bytes_align :: #force_inline proc(
err := free_bytes(old_data, allocator, loc)
return nil, err
}
if new_size == old_size {
if new_size == old_size && is_aligned(old_memory, alignment) {
return old_data, .None
}
new_memory : []byte