src/share/vm/utilities/quickSort.cpp

Print this page
rev 2779 : 7102044: G1: VM crashes with assert(old_end != new_end) failed: don't call this otherwise
Summary: arrayOopDesc::max_array_length() should return a value that does not overflow a size_t if it is converted to bytes.
Reviewed-by: stefank, kvn

*** 21,37 **** * questions. * */ #include "precompiled.hpp" - #include "utilities/quickSort.hpp" ! #ifndef PRODUCT ! // Unit tests #include "runtime/os.hpp" #include <stdlib.h> static int test_comparator(int a, int b) { if (a == b) { return 0; --- 21,37 ---- * questions. * */ #include "precompiled.hpp" ! /////////////// Unit tests /////////////// ! #ifndef PRODUCT #include "runtime/os.hpp" + #include "utilities/quickSort.hpp" #include <stdlib.h> static int test_comparator(int a, int b) { if (a == b) { return 0;
*** 92,102 **** sort<int, C>(arrayToSort, length, comparator, idempotent); return compare_arrays(arrayToSort, expectedResult, length); } bool QuickSort::test_quick_sort() { ! tty->print_cr("test_quick_sort\n"); { int* test_array = NULL; int* expected_array = NULL; assert(sort_and_compare(test_array, expected_array, 0, test_comparator), "Empty array not handled"); } --- 92,102 ---- sort<int, C>(arrayToSort, length, comparator, idempotent); return compare_arrays(arrayToSort, expectedResult, length); } bool QuickSort::test_quick_sort() { ! tty->print_cr("test_quick_sort"); { int* test_array = NULL; int* expected_array = NULL; assert(sort_and_compare(test_array, expected_array, 0, test_comparator), "Empty array not handled"); }