RFR(S): 8216426: Usage of array placement new may lead to memory corruption
Kim Barrett
kim.barrett at oracle.com
Tue Jan 15 01:48:08 UTC 2019
> On Jan 14, 2019, at 11:39 AM, Doerr, Martin <martin.doerr at sap.com> wrote:
>
> Hi,
>
> thanks for looking at this issue and especially for adding comments.
> Sounds like this issue should better get fixed although there are no known problems.
>
> Should we fix it by replacing the array placement new by normal placement new for each element?
> http://cr.openjdk.java.net/~mdoerr/8216426_array_placement_new/webrev.00/
>
> Best regards,
> Martin
Looks good.
------------------------------------------------------------------------------
src/hotspot/share/utilities/concurrentHashTable.hpp
76 // Only constructed with placement new from an array allocated with MEMFLAGS
77 // of InternalTable.
Given this comment, I'm tempted to suggest making the constructor
private and having a public "static Bucket* make_array(size_t size)"
function. Then remove the comment... But I'm not going to require
such a change to pass review.
------------------------------------------------------------------------------
src/hotspot/share/utilities/concurrentHashTable.inline.hpp
196 _buckets = (Bucket*)NEW_C_HEAP_ARRAY(Bucket, _size, F);
No cast needed here. NEW_C_HEAP_ARRAY(T, ...) returns T*.
I don't need another review for just this change.
------------------------------------------------------------------------------
More information about the hotspot-runtime-dev
mailing list