mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
reallocate in strings
This commit is contained in:
parent
b79230c069
commit
839095942d
4 changed files with 88 additions and 30 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue