RFR: 8010992: Remove calls to global ::operator new[] and new

David Holmes david.holmes at oracle.com
Mon Apr 15 16:15:01 PDT 2013


On 16/04/2013 4:46 AM, Ioi Lam wrote:
> On 04/14/2013 11:07 PM, David Holmes wrote:
>> Hi Yumin,
>>
>> On 13/04/2013 7:07 AM, Yumin Qi wrote:
>>> After take feedback and modify, new webrev
>>>
>>> http://cr.openjdk.java.net/~minqi/8010992/webrev1
>>> <http://cr.openjdk.java.net/%7Eminqi/8010992/webrev1>
>>
>> I still find the HandleMark changes unsatisfactory. The CHeap
>> allocated HandleMark in the Thread() constructor is a bit of a hack.
>> HandleMarks should be stack-allocated. Plus we seem to leak that CHeap
>> allocated HandleMark as we don't keep any pointer to it! I think this
>> needs to be re-visited, but as a separate CR.
>>
> David,
>
> The HandleMark is not leaked. It is freed in the Thread destructor:
>
> before:
>
>     355   delete last_handle_mark();

Ah! I see - thanks Ioi.

> after:
>
>     355   FREE_C_HEAP_ARRAY(HandleMark, last_handle_mark(), mtInternal);

Hmmmm - but it isn't an array - makes this part even uglier.

And this doesn't trigger the HandleMark destructor!

David
-----



> - Ioi


More information about the hotspot-runtime-dev mailing list