RFR: 8371637: allocateNativeInternal sometimes return incorrectly aligned memory

Kurt Miller kurt at openjdk.org
Thu Nov 13 17:05:25 UTC 2025


On Thu, 13 Nov 2025 14:59:53 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> I think what Maurizio is suggesting is probably the most flexible. We can assume that e.g. a 4 byte allocation is at least 4 byte aligned, and an 8 byte allocation is also at least 8 bytes aligned (which implies 4 byte alignment as well), up to a value equal to `alignof(max_align_t)`, which we currently assume to be 16 (though, we could have a native method that actually returns `alignof(max_align_t)`).

I see now. This makes sense to me. Thank you for explaining it.

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

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


More information about the core-libs-dev mailing list