runtime icon indicating copy to clipboard operation
runtime copied to clipboard

JIT alloc.h missing functionality to warn against using new and delete.

Open jashook opened this issue 11 years ago • 6 comments

Overloading the new and delete operator in alloc.h was removed to fix the build. See: 347ab205ca8a48ef445101b7a2e1499a9f59c596.

However, there should be some type of way to warn against using new or delete.

category:implementation theme:jit-coding-style skill-level:intermediate cost:small

jashook avatar Oct 30 '15 23:10 jashook

@pgavlin @russellhadley If I recall, this was done due to a conflict with the larger CLR. Can this PR be undone with @pgavlin's pending changes? If so, could you take it?

RussKeldorph avatar Mar 24 '16 16:03 RussKeldorph

Sure. @pgavlin can you take a look?

russellhadley avatar Mar 24 '16 16:03 russellhadley

I believe this was removed because the toolset treated static operator new as an error after vs 2015 update 1. It should be independent of the clr.

See the discussion in the pr here for more details https://github.com/dotnet/coreclr/pull/1903.

jashook avatar Mar 24 '16 16:03 jashook

@jashook Right, but I thought the reason the desired workaround (remove static) didn't work was because of conflicting definitions in CoreCLR. In theory, if these are the only overrides inside the separated JIT DLL/.so, there would be no conflict. I'm assuming JIT-internal conflicts either don't exist or can be removed at our whim.

If I'm off base, nevermind. Also, if this isn't trivial to fix, we can move it to future. I don't think it would block the release.

RussKeldorph avatar Mar 24 '16 20:03 RussKeldorph

No I believe you are correct, I forgot this aspect of the issue.

jashook avatar Mar 25 '16 15:03 jashook

Closing

BruceForstall avatar Oct 30 '22 21:10 BruceForstall