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

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


On Fri, 9 Jul 2021 03:57:40 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/memory/arena.hpp line 157:
>> 
>>> 155:   // is 4 bytes on 32 bits, hence the name.
>>> 156:   void *Amalloc_4(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
>>> 157:     assert((x & (sizeof(char*)-1)) == 0, "misaligned size");
>> 
>> This ought to be using `is_aligned`.
>
> The change to BytesPerWord for the alignment seems correct.

Thanks.

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

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


More information about the hotspot-dev mailing list