RFR: 8333658: NMT: Use an allocator with 4-byte pointers to save memory in NativeCallStackStorage

Johan Sjölen jsjolen at openjdk.org
Thu Jun 6 15:25:48 UTC 2024


On Thu, 6 Jun 2024 15:19:16 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> And we may want a function, complementing `at()`, that gives us the index for a given element pointer.
>
> I did start a port of the Treap to this allocator interface and there was no particular problem with using `free(I)` instead of `free(E* e)`. I gave up on that because it was a much larger change and I didn't know what the response would be to the interface itself (plus, we really do want to give back memory). Performing an inversion might not be easy. Consider something like a chunk allocator like our arena, translating index (`uint16_t chunk; uint16_t index;`) to a pointer requires walking the chunks.

The tests also uses the freeing functionality.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18979#discussion_r1629745865


More information about the hotspot-dev mailing list