src/hotspot/share/oops/objArrayKlass.cpp
changeset 50882 80abf702eed8
parent 50752 9d62da00bf15
child 51268 4ac20e5f96ce
equal deleted inserted replaced
50881:a21cad3fa448 50882:80abf702eed8
   171 
   171 
   172 objArrayOop ObjArrayKlass::allocate(int length, TRAPS) {
   172 objArrayOop ObjArrayKlass::allocate(int length, TRAPS) {
   173   if (length >= 0) {
   173   if (length >= 0) {
   174     if (length <= arrayOopDesc::max_array_length(T_OBJECT)) {
   174     if (length <= arrayOopDesc::max_array_length(T_OBJECT)) {
   175       int size = objArrayOopDesc::object_size(length);
   175       int size = objArrayOopDesc::object_size(length);
   176       return (objArrayOop)CollectedHeap::array_allocate(this, size, length, THREAD);
   176       return (objArrayOop)Universe::heap()->array_allocate(this, size, length,
       
   177                                                            /* do_zero */ true, THREAD);
   177     } else {
   178     } else {
   178       report_java_out_of_memory("Requested array size exceeds VM limit");
   179       report_java_out_of_memory("Requested array size exceeds VM limit");
   179       JvmtiExport::post_array_size_exhausted();
   180       JvmtiExport::post_array_size_exhausted();
   180       THROW_OOP_0(Universe::out_of_memory_error_array_size());
   181       THROW_OOP_0(Universe::out_of_memory_error_array_size());
   181     }
   182     }