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

Coleen Phillimore coleenp at openjdk.java.net
Mon Jul 26 18:32:35 UTC 2021


On Mon, 26 Jul 2021 17:18:50 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/memory/arena.cpp line 208:
>> 
>>> 206:        vm_exit_out_of_memory(bytes, OOM_MALLOC_ERROR, "Chunk::new");
>>> 207:      }
>>> 208:      assert(is_aligned(p, BytesPerLong), "Chunk start address not malloc aligned?");
>> 
>> Should this be ARENA_AMALLOC_ALIGNMENT, in case we have to change it back to 128 bits for some reason?
>
> Yes, I can do that too. I should try to set it to 128bits and test it. 
> 
> With 128 bit we may run into alignment problems with 32-bit platforms, since we rely on ARENA_AMALLOC_ALIGNMENT being <= malloc alignment, and on 32-bit I believe malloc alignment is just 64 bit. Not a showstopper, but may require a bit more care.

I was wondering if it would make an interesting test mode.

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

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


More information about the hotspot-dev mailing list