mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 11:22:19 +00:00
add List.clone
This commit is contained in:
parent
ebfcd71e8d
commit
f1ffc36efe
14 changed files with 147 additions and 4 deletions
|
@ -962,6 +962,14 @@ pub fn listIsUnique(
|
|||
return list.isEmpty() or list.isUnique();
|
||||
}
|
||||
|
||||
pub fn listClone(
|
||||
list: RocList,
|
||||
alignment: u32,
|
||||
element_width: usize,
|
||||
) callconv(.C) RocList {
|
||||
return list.makeUnique(alignment, element_width);
|
||||
}
|
||||
|
||||
pub fn listCapacity(
|
||||
list: RocList,
|
||||
) callconv(.C) usize {
|
||||
|
|
|
@ -75,6 +75,7 @@ comptime {
|
|||
exportListFn(list.listReplaceInPlace, "replace_in_place");
|
||||
exportListFn(list.listSwap, "swap");
|
||||
exportListFn(list.listIsUnique, "is_unique");
|
||||
exportListFn(list.listClone, "clone");
|
||||
exportListFn(list.listCapacity, "capacity");
|
||||
exportListFn(list.listAllocationPtr, "allocation_ptr");
|
||||
exportListFn(list.listReleaseExcessCapacity, "release_excess_capacity");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue