RFR: 8270179: Rename Amalloc_4
Thomas Stuefe
stuefe at openjdk.java.net
Mon Jul 12 06:12:57 UTC 2021
On Sun, 11 Jul 2021 23:27:33 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> This renames Amalloc_4 to AmallocWords. While I had to fix internal_malloc_4, which is a copy of Amalloc_4 (except with UseMallocOnly handling), I also made the change for
> JDK-8270217 Fix Arena::Amalloc to check for overflow better
> Tested with tier1 - all Oracle platforms and tier1-3 on linux-x64.
I'm not sure the alignment handling is correct. Either that or I don't understand the contract of the Amalloc... functions.
I thought:
- Amalloc(x) -> allocate x bytes, align returned pointer to 64bit
- AmallocWords(x) -> allocate x bytes, align returned pointer to pointer size
?
Because the functions just align the given byte size (well, `Amalloc()` aligns automatically, `AmallocWords()` asserts). But that has no effect on the returned pointer.
Consider this, on 32bit:
1) AmallocWords(4) -> _hwm = 4
2) Amalloc(8) -> will return a pointer to offset 4, so not 64bit aligned.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4750
More information about the hotspot-dev
mailing list