reallocate in strings

This commit is contained in:
Folkert 2021-05-01 23:16:28 +02:00
parent b79230c069
commit 839095942d
4 changed files with 88 additions and 30 deletions

View file

@ -120,14 +120,11 @@ pub const RocList = extern struct {
@memset(dest_ptr + old_length * element_width, 0, delta_length * element_width);
}
// NOTE the newly added elements are left uninitialized
const result = RocList{
.bytes = first_slot,
.length = new_length,
};
// NOTE we fuse an increment of all keys/values with a decrement of the input dict
utils.decref(allocator, alignment, self.bytes, old_length * element_width);
return result;