-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Use unsized delete when we calculate size dynamically in a custom new overload #119112
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
Conversation
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.
Pull Request Overview
This PR addresses issue #119099 by adding custom operator delete
overloads that delegate to unsized delete operators in classes that use dynamically calculated sizes in their custom new
operators. This ensures proper cleanup when objects are destroyed, avoiding potential undefined behavior from relying on sized delete with incorrect size values.
Key changes:
- Added custom sized
operator delete
overloads that call unsized::operator delete
- Applied this pattern consistently across three classes with dynamic size allocation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/coreclr/vm/virtualcallstub.h | Added sized delete operator to FastTable class that delegates to unsized delete |
src/coreclr/vm/methodtable.h | Added sized delete operator to MethodDataObject class that delegates to unsized delete |
src/coreclr/vm/crossloaderallocatorhash.h | Added sized delete operator to KeyValueStore class that delegates to unsized delete |
Tagging subscribers to this area: @mangod9 |
…lass as that's where the delete would route to.
Co-authored-by: Aaron Robinson <[email protected]>
Co-authored-by: Aaron Robinson <[email protected]>
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.
Fixes #119099