@@ -39,19 +39,19 @@ enum class ShenandoahFreeSetPartitionId : uint8_t {
3939 NotFree // Region is in no free set: it has no available memory
4040};
4141
42- // We do not maintain counts, capacity, or used for regions that are not free. Informally, if a region is NotFree, it is
43- // in no partition. NumPartitions represents the size of an array that may be indexed by Mutator or Collector.
44- #define NumPartitions (ShenandoahFreeSetPartitionId::NotFree)
45- #define IntNumPartitions int (ShenandoahFreeSetPartitionId::NotFree)
46- #define UIntNumPartitions uint (ShenandoahFreeSetPartitionId::NotFree)
47-
4842// ShenandoahRegionPartitions provides an abstraction to help organize the implementation of ShenandoahFreeSet. This
4943// class implements partitioning of regions into distinct sets. Each ShenandoahHeapRegion is either in the Mutator free set,
5044// the Collector free set, or in neither free set (NotFree). When we speak of a "free partition", we mean partitions that
5145// for which the ShenandoahFreeSetPartitionId is not equal to NotFree.
5246class ShenandoahRegionPartitions {
5347
5448private:
49+ // We do not maintain counts, capacity, or used for regions that are not free. Informally, if a region is NotFree, it is
50+ // in no partition. NumPartitions represents the size of an array that may be indexed by Mutator or Collector.
51+ static constexpr ShenandoahFreeSetPartitionId NumPartitions = ShenandoahFreeSetPartitionId::NotFree;
52+ static constexpr int IntNumPartitions = int (ShenandoahFreeSetPartitionId::NotFree);
53+ static constexpr uint UIntNumPartitions = uint(ShenandoahFreeSetPartitionId::NotFree);
54+
5555 const ssize_t _max; // The maximum number of heap regions
5656 const size_t _region_size_bytes;
5757 const ShenandoahFreeSet* _free_set;
0 commit comments