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

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Nov 20 14:31:58 UTC 2025


On Thu, 20 Nov 2025 13:44:39 GMT, Almaz <duke at openjdk.org> wrote:

> Are you intentionally linking GNU's C Library here instead of WG14?

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

Re. use of `MAX` vs. `MIN` I think the idea is that, while what `malloc` return *might* be page aligned, there's no guarantee for it to do so. Once you go past 8/16 bytes you are really on your own, unless you use an aligning allocation function (so we need to manually align by over-allocating and then slicing the result).

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

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


More information about the core-libs-dev mailing list