mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
add List.releaseExcessCapacity builtin
This commit is contained in:
parent
40b50b0091
commit
1319ba4844
13 changed files with 177 additions and 3 deletions
|
@ -29,9 +29,9 @@ use crate::llvm::{
|
|||
},
|
||||
build_list::{
|
||||
list_append_unsafe, list_concat, list_drop_at, list_get_unsafe, list_len, list_map,
|
||||
list_map2, list_map3, list_map4, list_prepend, list_replace_unsafe, list_reserve,
|
||||
list_sort_with, list_sublist, list_swap, list_symbol_to_c_abi, list_with_capacity,
|
||||
pass_update_mode,
|
||||
list_map2, list_map3, list_map4, list_prepend, list_release_excess_capacity,
|
||||
list_replace_unsafe, list_reserve, list_sort_with, list_sublist, list_swap,
|
||||
list_symbol_to_c_abi, list_with_capacity, pass_update_mode,
|
||||
},
|
||||
compare::{generic_eq, generic_neq},
|
||||
convert::{
|
||||
|
@ -707,6 +707,15 @@ pub(crate) fn run_low_level<'a, 'ctx, 'env>(
|
|||
update_mode,
|
||||
)
|
||||
}
|
||||
ListReleaseExcessCapacity => {
|
||||
// List.releaseExcessCapacity: List elem -> List elem
|
||||
debug_assert_eq!(args.len(), 1);
|
||||
|
||||
let (list, list_layout) = load_symbol_and_layout(scope, &args[0]);
|
||||
let element_layout = list_element_layout!(layout_interner, list_layout);
|
||||
|
||||
list_release_excess_capacity(env, layout_interner, list, element_layout, update_mode)
|
||||
}
|
||||
ListSwap => {
|
||||
// List.swap : List elem, Nat, Nat -> List elem
|
||||
debug_assert_eq!(args.len(), 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue