RFR: 8311648: Refactor the Arena/Chunk/ChunkPool interface [v7]

Thomas Stuefe stuefe at openjdk.org
Wed Aug 9 13:05:29 UTC 2023


On Wed, 9 Aug 2023 12:01:11 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> > Ah, I think I get it. I believe the real error is that when adding a chunk to the end of the Arena linked list, old code did not NULL-terminate the list since it relied on the Chunk being freshly initialized. IMHO, a slightly more robust and standard solution would be to explicitly NULL-terminate the list on add.
> 
> I think mentioning that `allocate_chunk` returns an initialized and null-terminated Chunk of requested size is sufficient. Explicitly null-terminating each time a `Chunk` is 'allocated' would require remembering that `Chunk`s may not be fresh.

Okay. Having a linked list op not terminating the end of the list goes against all my instincts, but that is fine :-)

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

PR Comment: https://git.openjdk.org/jdk/pull/14803#issuecomment-1671262990


More information about the hotspot-runtime-dev mailing list