ResourceHashtableBase deletes the ResourceHashtableNode only when the table is allocated on the C heap. For example:
https://github.com/openjdk/jdk/blob/09bfbf80639f059563fcd4432995b8c380cea298/src/hotspot/share/utilities/resourceHash.hpp#L99-L113
When "delete" is used, the destructors for ResourceHashtableNode::_key and ResourceHashtableNode::_value are also called. These destructors can perform clean up as necessary.
We should add a static assert that if the ResourceHashtable is not C-Heap allocated, the key and value must be types that are trivially destructible (see https://en.cppreference.com/w/cpp/types/is_destructible). Otherwise, the clean up expected by the key and value types will never happen.
https://github.com/openjdk/jdk/blob/09bfbf80639f059563fcd4432995b8c380cea298/src/hotspot/share/utilities/resourceHash.hpp#L99-L113
When "delete" is used, the destructors for ResourceHashtableNode::_key and ResourceHashtableNode::_value are also called. These destructors can perform clean up as necessary.
We should add a static assert that if the ResourceHashtable is not C-Heap allocated, the key and value must be types that are trivially destructible (see https://en.cppreference.com/w/cpp/types/is_destructible). Otherwise, the clean up expected by the key and value types will never happen.