RFR: 8301222: Generalize check_release_entry in OopStorage

Thomas Schatzl tschatzl at openjdk.org
Fri Mar 3 10:20:05 UTC 2023


On Fri, 27 Jan 2023 10:19:39 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

> When an oop handle is released to OopStorage, we want to check that its contents has been cleared appropriately, honouring the general contract with OopStorage. This is currently done with a raw access checking for null. However, the raw contents in memory might not be 0, just because the logical value is null. In particular, generational ZGC will have some low order colour bits set. This CR aims to address that.

Lgtm.

src/hotspot/share/gc/shared/collectedHeap.cpp line 156:

> 154: 
> 155: bool CollectedHeap::contains_null(const oop* p) {
> 156:   return *p == NULL;

Suggestion:

  return *p == nullptr;

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

Marked as reviewed by tschatzl (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12252


More information about the hotspot-gc-dev mailing list