Uh oh!
There was an error while loading. Please reload this page.
Use unsized delete when we calculate size dynamically in a custom new overload - #119112
Conversation
There was a problem hiding this comment.
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 deleteoverloads 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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Tagging subscribers to this area: @mangod9 |
…lass as that's where the delete would route to.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Uh oh!
There was an error while loading. Please reload this page.
Fixes#119099