Skip to content

Conversation

@rtfeldman
Copy link
Contributor

No description provided.

Comment on lines -1127 to +1133
@memcpy(source_a[(list_a.len() * element_width)..(total_length * element_width)], source_b[0..(list_b.len() * element_width)]);

// Use std.mem.copyForwards instead of @memcpy to handle potential aliasing
const dest_slice = source_a[(list_a.len() * element_width)..(total_length * element_width)];
const src_slice = source_b[0..(list_b.len() * element_width)];
std.mem.copyForwards(u8, dest_slice, src_slice);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, As per the zig docs, std.mem.copyForwards is deprecated and encourages the use of @memmove. Though in this case we know the direction ourselves, I don't know if @memmove has some other "magic" that would make it just as, or more performant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants