appendScalar zig implementation

This commit is contained in:
Folkert 2022-07-04 13:58:39 +02:00
parent 4f965ec263
commit a9ba08d8cb
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 83 additions and 3 deletions

View file

@ -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;