src/share/vm/utilities/growableArray.hpp

changeset 2040
0e35fa8ebccd
parent 1907
c18cbe5936b8
child 2314
f95d63e2154a
     1.1 --- a/src/share/vm/utilities/growableArray.hpp	Fri Jul 30 10:21:15 2010 -0700
     1.2 +++ b/src/share/vm/utilities/growableArray.hpp	Tue Aug 03 15:55:03 2010 -0700
     1.3 @@ -97,7 +97,10 @@
     1.4      assert(_len >= 0 && _len <= _max, "initial_len too big");
     1.5      _arena = (c_heap ? (Arena*)1 : NULL);
     1.6      set_nesting();
     1.7 -    assert(!c_heap || allocated_on_C_heap(), "growable array must be on C heap if elements are");
     1.8 +    assert(!on_C_heap() || allocated_on_C_heap(), "growable array must be on C heap if elements are");
     1.9 +    assert(!on_stack() ||
    1.10 +           (allocated_on_res_area() || allocated_on_stack()),
    1.11 +           "growable array must be on stack if elements are not on arena and not on C heap");
    1.12    }
    1.13  
    1.14    // This GA will use the given arena for storage.
    1.15 @@ -108,6 +111,10 @@
    1.16      assert(_len >= 0 && _len <= _max, "initial_len too big");
    1.17      _arena = arena;
    1.18      assert(on_arena(), "arena has taken on reserved value 0 or 1");
    1.19 +    // Relax next assert to allow object allocation on resource area,
    1.20 +    // on stack or embedded into an other object.
    1.21 +    assert(allocated_on_arena() || allocated_on_stack(),
    1.22 +           "growable array must be on arena or on stack if elements are on arena");
    1.23    }
    1.24  
    1.25    void* raw_allocate(int elementSize);

mercurial