RFR: 8269004 Implement ResizableResourceHashtable [v3]

Ioi Lam iklam at openjdk.java.net
Tue Jun 29 20:45:05 UTC 2021


On Tue, 29 Jun 2021 20:15:53 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> The cross product of Resizeable/Fixed x CHeap/ResourceAllocated is something that makes this hard to get my head around. Would you have a resizeable ResourceAllocated hashtable?
> Something doesn't seem right.

The choice of Resource vs CHeap depends on whether the table is accessed in a local scope. If you have a table that's used only locally, but it could (sometimes) store lots of elements, it may make sense to make it ResourceAllocated + Resizable.

> We have ResourceHashtables with fixed sizes in the code, and there are a couple of cases that use the CHeap allocation, and they need resizing. Maybe only have two choices to make things easier? Lots of indirection makes this really challenging to see if it's correct.
> It could be that you want the hashtable to be resource allocated but the elements are CHeap allocated. Which table is that? We had this discussion with GrowableArray and I believe we settled on that if the GrowableArray is CHeap allocated, all the elements are also.

Currently, the table and its elements are allocated by the same allocator. If `_table` is resource-allocated, then all the `Nodes` are also resource-allocated.

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

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


More information about the hotspot-dev mailing list