Skip to content

Commit e669d14

Browse files
committedMar 22, 2024
8328671: Mark allocate_new_tlab and unsafe_max_tlab_alloc of CollectedHeap as pure virtual
Reviewed-by: stefank, tschatzl
1 parent 940d196 commit e669d14

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed
 

‎src/hotspot/share/gc/shared/collectedHeap.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,6 @@ void CollectedHeap::fill_with_dummy_object(HeapWord* start, HeapWord* end, bool
518518
CollectedHeap::fill_with_object(start, end, zap);
519519
}
520520

521-
HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
522-
size_t requested_size,
523-
size_t* actual_size) {
524-
guarantee(false, "thread-local allocation buffers not supported");
525-
return nullptr;
526-
}
527-
528521
void CollectedHeap::ensure_parsability(bool retire_tlabs) {
529522
assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
530523
"Should only be called at a safepoint or at start-up");

‎src/hotspot/share/gc/shared/collectedHeap.hpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class CollectedHeap : public CHeapObj<mtGC> {
149149
// returned in actual_size.
150150
virtual HeapWord* allocate_new_tlab(size_t min_size,
151151
size_t requested_size,
152-
size_t* actual_size);
152+
size_t* actual_size) = 0;
153153

154154
// Reinitialize tlabs before resuming mutators.
155155
virtual void resize_all_tlabs();
@@ -345,10 +345,7 @@ class CollectedHeap : public CHeapObj<mtGC> {
345345
// An estimate of the maximum allocation that could be performed
346346
// for thread-local allocation buffers without triggering any
347347
// collection or expansion activity.
348-
virtual size_t unsafe_max_tlab_alloc(Thread *thr) const {
349-
guarantee(false, "thread-local allocation buffers not supported");
350-
return 0;
351-
}
348+
virtual size_t unsafe_max_tlab_alloc(Thread *thr) const = 0;
352349

353350
// If a GC uses a stack watermark barrier, the stack processing is lazy, concurrent,
354351
// incremental and cooperative. In order for that to work well, mechanisms that stop

0 commit comments

Comments
 (0)
Please sign in to comment.