RFR: 8371637: allocateNativeInternal sometimes return incorrectly aligned memory [v6]

Almaz duke at openjdk.org
Thu Nov 20 14:46:03 UTC 2025


On Thu, 20 Nov 2025 14:28:37 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> Yes, because I think that's where this "trick" came from in the first place.

Doesn't existence of this PR implies that hotspot is running in GNU libc non-conformant environments? With this patch applied `MAX_MALLOC_ALIGN` will assume GNU libc and at the same time there will be `allocationSize = Math.max(alignedSize, byteAlignment);` which is a workaround for cases where GNU libc guarantess do not hold.

Wouldn't it be safer to code against WG14's version?

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

PR Comment: https://git.openjdk.org/jdk/pull/28235#issuecomment-3558418909


More information about the core-libs-dev mailing list