src/share/vm/memory/allocation.cpp

changeset 2589
4a9604cd7c5f
parent 2557
f7de3327c683
child 2834
2a3da7eaf4a6
     1.1 --- a/src/share/vm/memory/allocation.cpp	Wed Mar 02 09:41:26 2011 +0100
     1.2 +++ b/src/share/vm/memory/allocation.cpp	Wed Mar 02 08:18:35 2011 -0500
     1.3 @@ -422,6 +422,9 @@
     1.4    return sum;                   // Return total consumed space.
     1.5  }
     1.6  
     1.7 +void Arena::signal_out_of_memory(size_t sz, const char* whence) const {
     1.8 +  vm_exit_out_of_memory(sz, whence);
     1.9 +}
    1.10  
    1.11  // Grow a new Chunk
    1.12  void* Arena::grow( size_t x ) {
    1.13 @@ -431,8 +434,9 @@
    1.14    Chunk *k = _chunk;            // Get filled-up chunk address
    1.15    _chunk = new (len) Chunk(len);
    1.16  
    1.17 -  if (_chunk == NULL)
    1.18 -      vm_exit_out_of_memory(len * Chunk::aligned_overhead_size(), "Arena::grow");
    1.19 +  if (_chunk == NULL) {
    1.20 +    signal_out_of_memory(len * Chunk::aligned_overhead_size(), "Arena::grow");
    1.21 +  }
    1.22  
    1.23    if (k) k->set_next(_chunk);   // Append new chunk to end of linked list
    1.24    else _first = _chunk;
    1.25 @@ -529,6 +533,7 @@
    1.26  // for debugging with UseMallocOnly
    1.27  void* Arena::internal_malloc_4(size_t x) {
    1.28    assert( (x&(sizeof(char*)-1)) == 0, "misaligned size" );
    1.29 +  check_for_overflow(x, "Arena::internal_malloc_4");
    1.30    if (_hwm + x > _max) {
    1.31      return grow(x);
    1.32    } else {

mercurial