Add some TODOs about memcpys

This commit is contained in:
Richard Feldman 2020-09-12 23:05:25 -04:00
parent 254b93a8ce
commit 4ef800d4b7
2 changed files with 4 additions and 0 deletions

View file

@ -1075,6 +1075,7 @@ pub fn list_concat<'a, 'ctx, 'env>(
let first_list_ptr = load_list_ptr(builder, first_list_wrapper, ptr_type);
// FIRST LOOP
// TODO when the element type supports it, replace FIRST_LOOP with a memcpy!
let first_loop = |first_index, first_list_elem| {
// The pointer to the element in the combined list
let combined_list_elem_ptr = unsafe {
@ -1110,6 +1111,7 @@ pub fn list_concat<'a, 'ctx, 'env>(
let second_list_ptr = load_list_ptr(builder, second_list_wrapper, ptr_type);
// SECOND LOOP
// TODO when the element type supports it, replace SECOND_LOOP with a memcpy!
let second_loop = |second_index, second_list_elem| {
// The pointer to the element in the combined list.
// Note that the pointer does not start at the index

View file

@ -102,6 +102,7 @@ pub fn str_concat<'a, 'ctx, 'env>(
let combined_str_ptr =
allocate_list(env, &CHAR_LAYOUT, combined_str_len);
// TODO replace FIRST_LOOP with a memcpy!
// FIRST LOOP
let first_loop = |first_index, first_str_elem| {
// The pointer to the element in the combined list
@ -135,6 +136,7 @@ pub fn str_concat<'a, 'ctx, 'env>(
// Reset the index variable to 0
builder.build_store(index_alloca, ctx.i64_type().const_int(0, false));
// TODO replace SECOND_LOOP with a memcpy!
// SECOND LOOP
let second_loop = |second_index, second_str_elem| {
// The pointer to the element in the combined str.