@@ -905,56 +905,6 @@ HeapWord* GenCollectedHeap::allocate_new_tlab(size_t min_size,
905
905
return result;
906
906
}
907
907
908
- // Requires "*prev_ptr" to be non-null. Deletes and a block of minimal size
909
- // from the list headed by "*prev_ptr".
910
- static ScratchBlock *removeSmallestScratch (ScratchBlock **prev_ptr) {
911
- bool first = true ;
912
- size_t min_size = 0 ; // "first" makes this conceptually infinite.
913
- ScratchBlock **smallest_ptr, *smallest;
914
- ScratchBlock *cur = *prev_ptr;
915
- while (cur) {
916
- assert (*prev_ptr == cur, " just checking" );
917
- if (first || cur->num_words < min_size) {
918
- smallest_ptr = prev_ptr;
919
- smallest = cur;
920
- min_size = smallest->num_words ;
921
- first = false ;
922
- }
923
- prev_ptr = &cur->next ;
924
- cur = cur->next ;
925
- }
926
- smallest = *smallest_ptr;
927
- *smallest_ptr = smallest->next ;
928
- return smallest;
929
- }
930
-
931
- // Sort the scratch block list headed by res into decreasing size order,
932
- // and set "res" to the result.
933
- static void sort_scratch_list (ScratchBlock*& list) {
934
- ScratchBlock* sorted = nullptr ;
935
- ScratchBlock* unsorted = list;
936
- while (unsorted) {
937
- ScratchBlock *smallest = removeSmallestScratch (&unsorted);
938
- smallest->next = sorted;
939
- sorted = smallest;
940
- }
941
- list = sorted;
942
- }
943
-
944
- ScratchBlock* GenCollectedHeap::gather_scratch (Generation* requestor,
945
- size_t max_alloc_words) {
946
- ScratchBlock* res = nullptr ;
947
- _young_gen->contribute_scratch (res, requestor, max_alloc_words);
948
- _old_gen->contribute_scratch (res, requestor, max_alloc_words);
949
- sort_scratch_list (res);
950
- return res;
951
- }
952
-
953
- void GenCollectedHeap::release_scratch () {
954
- _young_gen->reset_scratch ();
955
- _old_gen->reset_scratch ();
956
- }
957
-
958
908
void GenCollectedHeap::prepare_for_verify () {
959
909
ensure_parsability (false ); // no need to retire TLABs
960
910
}
0 commit comments