RFR: 8224509: Incorrect alignment in CDS related allocation code on 32-bit platforms [v2]
Calvin Cheung
ccheung at openjdk.java.net
Fri Oct 2 16:25:45 UTC 2020
On Fri, 2 Oct 2020 05:03:45 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/share/memory/archiveUtils.hpp line 33:
>>
>>> 31: #include "utilities/bitMap.hpp"
>>> 32:
>>> 33: #define SharedSpaceObjectAlignment 8
>>
>> I think we can use a `const int` instead of `#define`. Also, some comments will be helpful. Maybe:
>>
>> // Metaspace::allocate() requires that all blocks must be aligned with KlassAlignmentInBytes.
>> // We enforce the same alignment rule in blocks allocated from the shared space.
>> const int SharedSpaceObjectAlignment = KlassAlignmentInBytes;
>
> +1 to making the dependency on KlassAlignment explicit. Please do not hide any dependencies on Klass alignment behind
> literals (I am currently experimenting with increasing class space allocation alignment to increase the range of
> zero-based Klass* encoding)
Thanks @iklam and @tstuefe for the review.
I've made the change in webrev 01.
-------------
PR: https://git.openjdk.java.net/jdk/pull/476
More information about the hotspot-runtime-dev
mailing list