(11) RFR (S) JDK-8196880: VS2017 Addition of Global Delete Operator with Size Parameter Conflicts with Arena's Chunk Provided One
Thomas Stüfe
thomas.stuefe at gmail.com
Wed Feb 14 14:26:42 UTC 2018
Hi Lois,
thanks for fixing this!
Small nit, not part of your patch, but still:
Chunks get allocated via CHeapObj::operator new() but deleted in
Chunk::chop() with raw ::free(). Would it not be cleaner to call
CHeapObj::operator delete() instead (it does a free() too, but that would
be symmetrical? That would require that we actually implement
Chunk::operator delete(), I guess.
Best Regards, Thomas
On Wed, Feb 14, 2018 at 2:48 PM, Lois Foltan <lois.foltan at oracle.com> wrote:
> Please review this change in VS2017 to the delete operator due to C++14
> standard conformance. From https://msdn.microsoft.com/en-
> us/library/mt723604.aspx
>
> The function|void operator delete(void *, size_t)|was a placement delete
> operator corresponding to the placement new function "void * operator
> new(size_t, size_t)" in C++11. With C++14 sized deallocation, this delete
> function is now a/usual deallocation function/(global delete operator). The
> standard requires that if the use of a placement new looks up a
> corresponding delete function and finds a usual deallocation function, the
> program is ill-formed.
>
> Thank you to Kim Barrett for proposing the fix below.
>
> open webrev at http://cr.openjdk.java.net/~lfoltan/bug_jdk8196880/webrev/
> bug link https://bugs.openjdk.java.net/browse/JDK-8196880
>
> Testing complete (hs-tier1-3, jdk-tier1-3)
>
> Thanks,
> Lois
>
>
>
More information about the hotspot-dev
mailing list