mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
use new roc alloc stuff for List.set
This commit is contained in:
parent
91b49ecf98
commit
799e4a3239
2 changed files with 3 additions and 48 deletions
|
@ -989,7 +989,7 @@ inline fn listSetClone(
|
|||
|
||||
const data_bytes = length * element_width;
|
||||
|
||||
var new_bytes = utils.mallocWithRefcount(alignment, data_bytes);
|
||||
var new_bytes = utils.allocateWithRefcount(alignment, data_bytes);
|
||||
|
||||
@memcpy(new_bytes, old_bytes orelse undefined, data_bytes);
|
||||
|
||||
|
@ -1002,7 +1002,8 @@ inline fn listSetClone(
|
|||
// copy in the new element
|
||||
@memcpy(element_at_index, element orelse undefined, element_width);
|
||||
|
||||
// TODO decref the input list!
|
||||
// consume RC token of original
|
||||
utils.decref(alignment, old_bytes, data_bytes);
|
||||
|
||||
//return list;
|
||||
return new_bytes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue