@@ -76,7 +76,7 @@ class HadesGC final : public GCBase {
76
76
static constexpr uint32_t maxAllocationSizeImpl () {
77
77
// The largest allocation allowable in Hades is the max size a single
78
78
// segment supports.
79
- return AlignedHeapSegment ::maxSize ();
79
+ return FixedSizeHeapSegment ::maxSize ();
80
80
}
81
81
82
82
static constexpr uint32_t minAllocationSizeImpl () {
@@ -297,7 +297,7 @@ class HadesGC final : public GCBase {
297
297
298
298
// / \return true if the pointer lives in the young generation.
299
299
bool inYoungGen (const void *p) const override {
300
- return youngGen_.lowLim () == AlignedHeapSegment ::storageStart (p);
300
+ return youngGen_.lowLim () == FixedSizeHeapSegment ::storageStart (p);
301
301
}
302
302
bool inYoungGen (CompressedPointer p) const {
303
303
return p.getSegmentStart () == youngGenCP_;
@@ -361,34 +361,34 @@ class HadesGC final : public GCBase {
361
361
// / Call \p callback on every non-freelist cell allocated in this segment.
362
362
template <typename CallbackFunction>
363
363
static void forAllObjsInSegment (
364
- AlignedHeapSegment &seg,
364
+ FixedSizeHeapSegment &seg,
365
365
CallbackFunction callback);
366
366
// / Only call the callback on cells without forwarding pointers.
367
367
template <typename CallbackFunction>
368
368
static void forCompactedObjsInSegment (
369
- AlignedHeapSegment &seg,
369
+ FixedSizeHeapSegment &seg,
370
370
CallbackFunction callback,
371
371
PointerBase &base);
372
372
373
373
class OldGen final {
374
374
public:
375
375
explicit OldGen (HadesGC &gc);
376
376
377
- std::deque<AlignedHeapSegment >::iterator begin ();
378
- std::deque<AlignedHeapSegment >::iterator end ();
379
- std::deque<AlignedHeapSegment >::const_iterator begin () const ;
380
- std::deque<AlignedHeapSegment >::const_iterator end () const ;
377
+ std::deque<FixedSizeHeapSegment >::iterator begin ();
378
+ std::deque<FixedSizeHeapSegment >::iterator end ();
379
+ std::deque<FixedSizeHeapSegment >::const_iterator begin () const ;
380
+ std::deque<FixedSizeHeapSegment >::const_iterator end () const ;
381
381
382
382
size_t numSegments () const ;
383
383
384
- AlignedHeapSegment &operator [](size_t i);
384
+ FixedSizeHeapSegment &operator [](size_t i);
385
385
386
386
// / Take ownership of the given segment.
387
- void addSegment (AlignedHeapSegment seg);
387
+ void addSegment (FixedSizeHeapSegment seg);
388
388
389
389
// / Remove the last segment from the OG.
390
390
// / \return the segment that was removed.
391
- AlignedHeapSegment popSegment ();
391
+ FixedSizeHeapSegment popSegment ();
392
392
393
393
// / Indicate that OG should target having a size of \p targetSizeBytes.
394
394
void setTargetSizeBytes (size_t targetSizeBytes);
@@ -507,7 +507,7 @@ class HadesGC final : public GCBase {
507
507
static constexpr size_t kMinSizeForLargeBlock = 1
508
508
<< kLogMinSizeForLargeBlock ;
509
509
static constexpr size_t kNumLargeFreelistBuckets =
510
- llvh::detail::ConstantLog2<AlignedHeapSegment ::maxSize()>::value -
510
+ llvh::detail::ConstantLog2<FixedSizeHeapSegment ::maxSize()>::value -
511
511
kLogMinSizeForLargeBlock + 1 ;
512
512
static constexpr size_t kNumFreelistBuckets =
513
513
kNumSmallFreelistBuckets + kNumLargeFreelistBuckets ;
@@ -578,7 +578,7 @@ class HadesGC final : public GCBase {
578
578
579
579
// / Use a std::deque instead of a std::vector so that references into it
580
580
// / remain valid across a push_back.
581
- std::deque<AlignedHeapSegment > segments_;
581
+ std::deque<FixedSizeHeapSegment > segments_;
582
582
583
583
// / See \c targetSizeBytes() above.
584
584
ExponentialMovingAverage targetSizeBytes_{0 , 0 };
@@ -660,9 +660,9 @@ class HadesGC final : public GCBase {
660
660
// / Keeps the storage provider alive until after the GC is fully destructed.
661
661
std::shared_ptr<StorageProvider> provider_;
662
662
663
- // / youngGen is a bump-pointer space, so it can re-use AlignedHeapSegment .
663
+ // / youngGen is a bump-pointer space, so it can re-use FixedSizeHeapSegment .
664
664
// / Protected by gcMutex_.
665
- AlignedHeapSegment youngGen_;
665
+ FixedSizeHeapSegment youngGen_;
666
666
AssignableCompressedPointer youngGenCP_;
667
667
668
668
// / List of cells in YG that have finalizers. Iterate through this to clean
@@ -672,7 +672,7 @@ class HadesGC final : public GCBase {
672
672
673
673
// / Since YG collection times are the primary driver of pause times, it is
674
674
// / useful to have a knob to reduce the effective size of the YG. This number
675
- // / is the fraction of AlignedHeapSegment ::maxSize() that we should use for
675
+ // / is the fraction of FixedSizeHeapSegment ::maxSize() that we should use for
676
676
// / the YG.. Note that we only set the YG size using this at the end of the
677
677
// / first real YG, since doing it for direct promotions would waste OG memory
678
678
// / without a pause time benefit.
@@ -772,7 +772,7 @@ class HadesGC final : public GCBase {
772
772
// / \return true if the pointer lives in the segment that is being marked or
773
773
// / evacuated for compaction.
774
774
bool contains (const void *p) const {
775
- return start == AlignedHeapSegment ::storageStart (p);
775
+ return start == FixedSizeHeapSegment ::storageStart (p);
776
776
}
777
777
bool contains (CompressedPointer p) const {
778
778
return p.getSegmentStart () == startCP;
@@ -781,7 +781,7 @@ class HadesGC final : public GCBase {
781
781
// / \return true if the pointer lives in the segment that is currently being
782
782
// / evacuated for compaction.
783
783
bool evacContains (const void *p) const {
784
- return evacStart == AlignedHeapSegment ::storageStart (p);
784
+ return evacStart == FixedSizeHeapSegment ::storageStart (p);
785
785
}
786
786
bool evacContains (CompressedPointer p) const {
787
787
return p.getSegmentStart () == evacStartCP;
@@ -829,7 +829,7 @@ class HadesGC final : public GCBase {
829
829
// / The segment being compacted. This should be removed from the OG right
830
830
// / after it is identified, and freed entirely once the compaction is
831
831
// / complete.
832
- std::shared_ptr<AlignedHeapSegment > segment;
832
+ std::shared_ptr<FixedSizeHeapSegment > segment;
833
833
} compactee_;
834
834
835
835
// / The number of compactions this GC has performed.
@@ -964,7 +964,7 @@ class HadesGC final : public GCBase {
964
964
template <bool CompactionEnabled>
965
965
void scanDirtyCardsForSegment (
966
966
EvacAcceptor<CompactionEnabled> &acceptor,
967
- AlignedHeapSegment &segment);
967
+ FixedSizeHeapSegment &segment);
968
968
969
969
// / Find all pointers from OG into the YG/compactee during a YG collection.
970
970
// / This is done quickly through use of write barriers that detect the
@@ -1011,19 +1011,19 @@ class HadesGC final : public GCBase {
1011
1011
uint64_t heapFootprint () const ;
1012
1012
1013
1013
// / Accessor for the YG.
1014
- AlignedHeapSegment &youngGen () {
1014
+ FixedSizeHeapSegment &youngGen () {
1015
1015
return youngGen_;
1016
1016
}
1017
- const AlignedHeapSegment &youngGen () const {
1017
+ const FixedSizeHeapSegment &youngGen () const {
1018
1018
return youngGen_;
1019
1019
}
1020
1020
1021
1021
// / Create a new segment (to be used by either YG or OG).
1022
- llvh::ErrorOr<AlignedHeapSegment > createSegment ();
1022
+ llvh::ErrorOr<FixedSizeHeapSegment > createSegment ();
1023
1023
1024
1024
// / Set a given segment as the YG segment.
1025
1025
// / \return the previous YG segment.
1026
- AlignedHeapSegment setYoungGen (AlignedHeapSegment seg);
1026
+ FixedSizeHeapSegment setYoungGen (FixedSizeHeapSegment seg);
1027
1027
1028
1028
// / Get/set the current number of external bytes used by the YG.
1029
1029
size_t getYoungGenExternalBytes () const ;
@@ -1048,7 +1048,7 @@ class HadesGC final : public GCBase {
1048
1048
// / \param extraName append this to the name of the segment. Must be
1049
1049
// / non-empty.
1050
1050
void addSegmentExtentToCrashManager (
1051
- const AlignedHeapSegment &seg,
1051
+ const FixedSizeHeapSegment &seg,
1052
1052
const std::string &extraName);
1053
1053
1054
1054
// / Deletes a segment from the CrashManager's custom data.
0 commit comments