-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add @memmove
builtin
#22605
base: master
Are you sure you want to change the base?
add @memmove
builtin
#22605
Conversation
4e8a431
to
c976221
Compare
|
Whoops the order is the same, I just wrote it wrong. It has the same length checks too - will update the OP. |
Just noting that we concluded in the discussion that |
3602635
to
d67f0b0
Compare
Additionally, per the |
Does deprecation mean replace with |
Doc comment. I think it's removal that either means outright deletion, or |
f8d1141
to
7f0001a
Compare
21b518e
to
99eff11
Compare
7a4c39c
to
fd577a8
Compare
I don't know what the aarch64-macos-debug CI issue is - it failed before and after a rebase for |
Looks like the aarch64-macos-debug CI issue is unrelated, there are other PRs that are having the same failure. |
macho linker bug filed at #23010 |
This PR adds a new builtin
@memmove(dest: T, src: T) void
. It is similar to@memcpy
except it can be used for overlapping memory regions. The intended semantics are:src
anddest
can each be a slice, pointer to array, or many-item pointersrc
anddest
must provide a length, and if they both do the lengths must be the sameunlike (the intended runtime, and current comptime) behaviour of@memcpy
,@memmove
requires the element type ofsrc
anddest
to be coercible to each other in memory@memmove(dest, src)
is thatdest[0..len]
contains bytes as if a element-by-element loop copiedsrc[0..len]
to an auxiliary buffer, and then a second loop copied from that buffer todest[0..len]
.This builtin is currently using up the last ZIR tag.
Related: #767