On Tue, 26 Sep 2023 12:47:42 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
> This change makes WeakHandle and OopHandle release null out the obj pointer, > at the cost of making the release function non-const and some changes that > propagated from that. This enables ObjectMonitor code to test for null to > see if the obj was already released, and seems like the right thing to do. > See comments from related PR in the bug report. > Tested with tier1-4. OopHandles and WeakHandles don't have destructors (or copy constructors and assignment operators). Places where we release the storage would have to be reworked significantly to have this sort of usage model: eg, releasing a String from the StringTable is done with a callback from the CHT static void free_node(void* context, void* memory, Value const& value) { value.release(StringTable::_oop_storage); FreeHeap(memory); StringTable::item_removed(); } ------------- PR Comment: https://git.openjdk.org/jdk/pull/15920#issuecomment-1737281090