improve list allocation

This commit is contained in:
Folkert 2020-11-19 16:11:21 +01:00
parent b61f5d02b9
commit 45c62dfa3c
2 changed files with 11 additions and 48 deletions

View file

@ -56,9 +56,11 @@ pub fn str_split<'a, 'ctx, 'env>(
)
.into_int_value();
// a pointer to the elements
let ret_list_ptr =
allocate_list(env, inplace, &Layout::Builtin(Builtin::Str), segment_count);
// convert `*mut RocStr` to `*mut i128`
let ret_list_ptr_u128s = builder.build_bitcast(
ret_list_ptr,
ctx.i128_type().ptr_type(AddressSpace::Generic),