mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-19 12:35:07 +00:00
appendScalar zig implementation
This commit is contained in:
parent
4f965ec263
commit
a9ba08d8cb
2 changed files with 83 additions and 3 deletions
|
@ -256,6 +256,10 @@ pub fn unsafeReallocate(
|
|||
const old_width = align_width + old_length * element_width;
|
||||
const new_width = align_width + new_length * element_width;
|
||||
|
||||
if (old_width == new_width) {
|
||||
return source_ptr;
|
||||
}
|
||||
|
||||
// TODO handle out of memory
|
||||
// NOTE realloc will dealloc the original allocation
|
||||
const old_allocation = source_ptr - align_width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue