RFR #2 (S) CR 8015270: @Contended: fix multiple issues in the layout code
Aleksey Shipilev
aleksey.shipilev at oracle.com
Mon May 27 13:21:01 PDT 2013
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.
More information about the hotspot-runtime-dev
mailing list