RFR: 8270179: Rename Amalloc_4

Thomas Stuefe stuefe at openjdk.java.net
Mon Jul 12 05:13:50 UTC 2021


On Mon, 12 Jul 2021 05:06:48 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Why do we still have UseMallocOnly? There's one test for it but why.

I always thought it is done to find overwriters between individual arena allocations by moving them out of the arena block. You also get the malloc headers with the canaries in os::malloc (debug builds only), which would trip you on overwrites when the arena is cleaned and all allocations are deleted.

But I think it's too complex and too much code for this purpose and could be done differently. In Metaspace, I add optional canary gaps between individual allocations within the arena itself (https://github.com/openjdk/jdk/blob/master/src/hotspot/share/memory/metaspace/allocationGuard.hpp) and test them periodically, which achieves the same goal with less code. It also means you don't need to individually free them.

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

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


More information about the hotspot-dev mailing list