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:32:44 UTC 2024


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

>> 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.

>). 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.

Wait, I should've rested before I wrote that. Obviously we need to be able to make fast inversions for accessing the underlying element anyway. Still, the rest of what I wrote makes sense!

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

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


More information about the hotspot-dev mailing list