Print this page


Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/memory/allocation.cpp
          +++ new/src/share/vm/memory/allocation.cpp
↓ open down ↓ 555 lines elided ↑ open up ↑
 556  556  
 557  557  // Grow a new Chunk
 558  558  void* Arena::grow(size_t x, AllocFailType alloc_failmode) {
 559  559    // Get minimal required size.  Either real big, or even bigger for giant objs
 560  560    size_t len = MAX2(x, (size_t) Chunk::size);
 561  561  
 562  562    Chunk *k = _chunk;            // Get filled-up chunk address
 563  563    _chunk = new (alloc_failmode, len) Chunk(len);
 564  564  
 565  565    if (_chunk == NULL) {
      566 +    _chunk = k;                 // restore the value of _chunk
 566  567      return NULL;
 567  568    }
 568  569    if (k) k->set_next(_chunk);   // Append new chunk to end of linked list
 569  570    else _first = _chunk;
 570  571    _hwm  = _chunk->bottom();     // Save the cached hwm, max
 571  572    _max =  _chunk->top();
 572  573    set_size_in_bytes(size_in_bytes() + len);
 573  574    void* result = _hwm;
 574  575    _hwm += x;
 575  576    return result;
↓ open down ↓ 247 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX