RFR: 8301404: Replace os::malloc with os::realloc, so we only have 1 code path

Thomas Stuefe stuefe at openjdk.org
Fri Feb 17 22:02:25 UTC 2023


On Fri, 17 Feb 2023 16:42:09 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

> Please review this enhancement, which eliminates a duplicate and almost identical path we have for malloc() and realloc(), and collapses  them down to only one codepath, by taking advantage of fact that `malloc() == realloc(NULL)`
> 
> Tested with MACH5 tier1,2,3,4,5

Not a big fan, tbh. I find your code harder to decipher than the original version. Malloc and realloc are different things, and having different code paths for them makes more sense than mixing them together. 

I am currently revising NMTPreInit (see https://github.com/tstuefe/jdk/tree/make-nmt-preinit-cheaper-for-nmt-off) and plan to continue this work after my vacation in march; it would be nice if we could synchronize work then.

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

PR: https://git.openjdk.org/jdk/pull/12621


More information about the hotspot-runtime-dev mailing list