They clear the handle but not the pointer. They should clear the pointer too so you can test whether the handle is released in some cases.
inline void OopHandle::release(OopStorage* storage) {
if (_obj != nullptr) {
// Clear the OopHandle first
NativeAccess<>::oop_store(_obj, nullptr);
storage->release(_obj);
}
}
inline void OopHandle::release(OopStorage* storage) {
if (_obj != nullptr) {
// Clear the OopHandle first
NativeAccess<>::oop_store(_obj, nullptr);
storage->release(_obj);
}
}
- relates to
-
JDK-8256302 releasing oopStorage when deflating allows for faster deleting
-
- Resolved
-