From b94b679e9a82ff2ee6daee9631ce707e9b9eaf6b Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Sat, 10 Jun 2023 17:08:46 +0000 Subject: [PATCH] 8309627: Incorrect sorting of DirtyCardQueue buffers Reviewed-by: ayang, shade --- src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp index 66dff511f07..1dbe4fd2406 100644 --- a/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp +++ b/src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp @@ -346,8 +346,8 @@ class G1RefineBufferedCards : public StackObj { G1ConcurrentRefineStats* _stats; G1RemSet* const _g1rs; - static inline int compare_card(const CardTable::CardValue* p1, - const CardTable::CardValue* p2) { + static inline ptrdiff_t compare_cards(const CardTable::CardValue* p1, + const CardTable::CardValue* p2) { return p2 - p1; } @@ -357,7 +357,7 @@ class G1RefineBufferedCards : public StackObj { void sort_cards(size_t start_index) { QuickSort::sort(&_node_buffer[start_index], _node_buffer_size - start_index, - compare_card, + compare_cards, false); }