RFR: 8253779: Amalloc may be wasting space by overaligning [v2]

Coleen Phillimore coleenp at openjdk.java.net
Fri Jul 9 14:13:56 UTC 2021


On Fri, 9 Jul 2021 05:06:10 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Improvements ala Kim
>
> src/hotspot/share/memory/arena.hpp line 36:
> 
>> 34: 
>> 35: // The byte alignment to be used by Arena::Amalloc.
>> 36: #define ARENA_AMALLOC_ALIGNMENT BytesPerLong
> 
> We don't store types in here which need alignment larger than 64bit? eg long double?
> 
> .. I searched and found no cases where they lived inside an arena, so it's probably fine.

I don't think so.  I'm not sure how to search for that if there are any.

> src/hotspot/share/memory/arena.hpp line 140:
> 
>> 138:   // on both 32 and 64 bit platforms. Required for atomic jlong operations on 32 bits.
>> 139:   void* Amalloc(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
>> 140:     STATIC_ASSERT(is_power_of_2(ARENA_AMALLOC_ALIGNMENT));
> 
> Move this static assert up to the definition of ARENA_AMALLOC_ALIGNMENT?

ok, can do that.  It looks funny but it compiles.

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

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


More information about the hotspot-dev mailing list