RFR #2 (S) CR 8015270: @Contended: fix multiple issues in the layout code
Daniel D. Daugherty
daniel.daugherty at oracle.com
Mon May 27 14:19:57 PDT 2013
On 5/27/13 2:21 PM, Aleksey Shipilev wrote:
> On 05/28/2013 12:17 AM, Daniel D. Daugherty wrote:
>>> Tracing through the code if you get to Amalloc and pass zero then I
>>> think things will break because it will return the address of the next
>>> empty slot. The next call to Amalloc with a non-zero value will have
>>> the exact same address returned!
>> Agreed on the semantics of Amalloc(). I took a quick look at most of the
>> places that have NEW_RESOURCE and I think there are a few that just
>> might be passing zero...
>>
>> Aleksey's "+ 1" code is safer...
> Would it be a good bullet-proofing to put the assert() into the
> NEW_RESOURCE macro then? This +1 does confuse unexperienced people like me.
>
> -Aleksey.
Given that it is Amalloc() that will hand out the same address for
back to back calls like this (we think):
addr1 = Amalloc(0);
addr2 = Amalloc(1024);
I don't think the NEW_RESOURCE macro is the right place.
However, I'd love to drag Zhengyu into the conversation, but he's
likely out of the office today due to the Memorial holiday (in
the US).
Dan
More information about the hotspot-runtime-dev
mailing list