-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[NativeAOT] Remove unused native memcopy helpers. #84314
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsManaged memcopy nowdays only calls native helpers to set cards, if needed. The native helpers to do memory copying are dead code and it looks like they have been dead code for a while and may not even function correctly. One example - it looks like EH knew how to handle AV in these, but the support was somehow lost with time.
|
} | ||
|
||
InlineGCSafeFillMemory(mem, size, pv); | ||
InlineGCSafeFillMemory(mem, size, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this to InlineGCSafeZeroMemory
and delete the extra argument?
@@ -21,91 +21,17 @@ | |||
// | |||
// USAGE: The caller is responsible for hoisting any null reference exceptions to a place where the hardware exception | |||
// can be properly translated to a managed exception. | |||
COOP_PINVOKE_CDECL_HELPER(void *, RhpInitMultibyte, (void * mem, int c, size_t size)) | |||
COOP_PINVOKE_CDECL_HELPER(void *, RhpInitMultibyte, (void * mem, size_t size)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the comment and/or the name to indicate that the buffer can contain GC references?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I am also tempted to move this to a managed helper as well, but I do not see a lot of reasons.
This is only used when unboxing a nullable null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move this to managed when/if we have a caller that could realistically need to zero something larger than BulkMoveWithWriteBarrierChunk
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
Thanks!! |
Managed memcopy nowdays calls
RhBulkMoveWithWriteBarrier
and only when the copy needs to set cards.The native helpers to do memory copying are dead code and it looks like they have been dead code for a while and may not even function correctly. One example - it looks like EH knew how to handle AV in these, but the support was somehow lost with time.