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

Almaz duke at openjdk.org
Mon Nov 17 20:37:05 UTC 2025


On Mon, 17 Nov 2025 16:23:42 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> i.e. don't assume any alignment for e.g. 7 byte allocations

Section 7.25.4.1 of [the libc standard](https://open-std.org/JTC1/SC22/WG14/www/docs/n3685.pdf) says

> The pointer returned if the allocation succeeds is
suitably aligned so that it can be assigned to a pointer to any type of object with a fundamental
alignment requirement and size less than or equal to the size requested

IIUC it should be at least 4 bytes aligned

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28235#discussion_r2535435790


More information about the core-libs-dev mailing list