RFR: 8270179: Rename Amalloc_4

Coleen Phillimore coleenp at openjdk.java.net
Mon Jul 12 13:54:53 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.

Thomas, you're right.  More bugs in this code!

>> My guess would be that the only widely relevant 32bit architecture was x86, and they allow unaligned access. I wonder how 32bit arm handles this. Maybe allocating 32bit words of memory is just very rare.

> Maybe using a given arena for a mix of operations doesn't happen? If only Amalloc is used for an arena then it will stay 8 byte aligned.

I think this is the case. The case for aligning to 64 bits for 32 bit platforms was added for bug JDK-4526490 but I can't really follow where the unaligned load is coming from in that case. The test program is Java so the interpreter will do the volatile loads correctly regardless of alignment, so I think the problem was with Xcomp. I suppose I can put a comment and file *another* bug.

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

PR: https://git.openjdk.java.net/jdk/pull/4750


More information about the hotspot-dev mailing list