RFR: 8270179: Rename Amalloc_4

Kim Barrett kbarrett at openjdk.java.net
Mon Jul 12 05:30:02 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.

Looks good.  One possible naming nit.  I agree that UseMallocOnly might not be pulling its weight.

> ... I also made the change for
> JDK-8270217 Fix Arena::Amalloc to check for overflow better

You should add that bug to this PR via `/issue add JDK-8270217`

src/hotspot/share/memory/arena.hpp line 105:

> 103:   debug_only(void* malloc(size_t size);)
> 104: 
> 105:   void* internal_malloc_words(size_t x, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM)  {

If UseMallocOnly is retained, I think a better name for this would be internal_amalloc_only, to avoid confusion with the case of actually using malloc.  (And yes, this can be taken as another argument for nuking that option.)

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

Marked as reviewed by kbarrett (Reviewer).

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


More information about the hotspot-dev mailing list