RFR: JDK-8270308: Amalloc aligns size but not return value (take 2) [v3]

Coleen Phillimore coleenp at openjdk.java.net
Mon Jul 26 13:36:09 UTC 2021


On Sat, 24 Jul 2021 20:49:38 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>>> The comment here is stale.
>> 
>> Yes, I know. See my initial PR text.
>> 
>> I left it in since my first fix was rejected for being too complex, so I wanted to limit this patch to the absolute minimum needed. 
>> 
>> I do not think aligning the allocation size - or insisting on an aligned allocation size as the sister method `AmallocWords` does - is useful at all. Removing the comment just leaves the code, which leaves the reader to ask himself why it's in there. Leaving the comment at least states the reason the original author saw. We should either remove the code and the comment or leave both in place.
>
> The length alignment (either by adjustment or by precondition) is what lets the ARENA_ALIGN of _hwm be 32bit only in Amalloc, and not needed in AmallocWords.  Maybe you are suggesting dropping the size alignment and instead unconditionally aligning _hwm as needed for the operation?  Maybe that's the next RFE?

Oh please no more RFEs unless Kim can review them.  This turned out much more difficult than we thought it would be!
This comment is true though, right?  For 32 bits if you do an AmallocWords then Amalloc, the _hwm will then be aligned to ARENA_ALIGN, ie 64 bits.  That's ok.  That seems like just what we want.  Although it seems like this latter comment says what I think this does better.  I'm fine with leaving the comment though.  Makes you think about it anyway.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4835


More information about the hotspot-dev mailing list