559 |
559 |
560 Chunk *k = _chunk; // Get filled-up chunk address |
560 Chunk *k = _chunk; // Get filled-up chunk address |
561 _chunk = new (alloc_failmode, len) Chunk(len); |
561 _chunk = new (alloc_failmode, len) Chunk(len); |
562 |
562 |
563 if (_chunk == NULL) { |
563 if (_chunk == NULL) { |
|
564 _chunk = k; // restore the previous value of _chunk |
564 return NULL; |
565 return NULL; |
565 } |
566 } |
566 if (k) k->set_next(_chunk); // Append new chunk to end of linked list |
567 if (k) k->set_next(_chunk); // Append new chunk to end of linked list |
567 else _first = _chunk; |
568 else _first = _chunk; |
568 _hwm = _chunk->bottom(); // Save the cached hwm, max |
569 _hwm = _chunk->bottom(); // Save the cached hwm, max |