src/share/vm/utilities/quickSort.cpp

changeset 4967
5a9fa2ba85f0
parent 4962
6f817ce50129
child 5103
f9be75d21404
child 5106
e76dd894b984
     1.1 --- a/src/share/vm/utilities/quickSort.cpp	Fri Apr 19 11:08:52 2013 -0700
     1.2 +++ b/src/share/vm/utilities/quickSort.cpp	Sun Apr 21 20:41:04 2013 -0700
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -30,8 +30,6 @@
    1.11  
    1.12  #include "runtime/os.hpp"
    1.13  #include "utilities/quickSort.hpp"
    1.14 -#include "memory/allocation.hpp"
    1.15 -#include "memory/allocation.inline.hpp"
    1.16  #include <stdlib.h>
    1.17  
    1.18  static int test_comparator(int a, int b) {
    1.19 @@ -189,8 +187,8 @@
    1.20    // test sorting random arrays
    1.21    for (int i = 0; i < 1000; i++) {
    1.22      int length = os::random() % 100;
    1.23 -    int* test_array = NEW_C_HEAP_ARRAY(int, length, mtInternal);
    1.24 -    int* expected_array = NEW_C_HEAP_ARRAY(int, length, mtInternal);
    1.25 +    int* test_array = new int[length];
    1.26 +    int* expected_array = new int[length];
    1.27      for (int j = 0; j < length; j++) {
    1.28          // Choose random values, but get a chance of getting duplicates
    1.29          test_array[j] = os::random() % (length * 2);
    1.30 @@ -212,8 +210,8 @@
    1.31      sort(test_array, length, test_even_odd_comparator, true);
    1.32      assert(compare_arrays(test_array, expected_array, length), "Sorting already sorted array changed order of elements - not idempotent");
    1.33  
    1.34 -    FREE_C_HEAP_ARRAY(int, test_array, mtInternal);
    1.35 -    FREE_C_HEAP_ARRAY(int, expected_array, mtInternal);
    1.36 +    delete[] test_array;
    1.37 +    delete[] expected_array;
    1.38    }
    1.39  }
    1.40  

mercurial