RFR: Use static assert to validate card offset encoding mask

Y. Srinivas Ramakrishna ysr at openjdk.org
Fri May 12 21:54:22 UTC 2023


On Fri, 12 May 2023 16:12:16 GMT, William Kemper <wkemper at openjdk.org> wrote:

> Follow up to https://github.com/openjdk/shenandoah/pull/275 - replace runtime assert with static assert.

LGTM; minor documentation suggestion.

🚢

src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.hpp line 400:

> 398:   static const int MaxCardSize = NOT_LP64(512) LP64_ONLY(1024);
> 399:   STATIC_ASSERT((MaxCardSize / HeapWordSize) - 1 <= FirstStartBits);
> 400: 

May be leave a reference to the raw values for `MaxCardSize` as coming from the range for `GCCardSizeInBytes` e.g. in `gc_globals.hpp`.

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

Marked as reviewed by ysr (Committer).

PR Review: https://git.openjdk.org/shenandoah/pull/279#pullrequestreview-1425193780
PR Review Comment: https://git.openjdk.org/shenandoah/pull/279#discussion_r1192820463


More information about the shenandoah-dev mailing list