/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "adlc.hpp"
}
CHeapObj::operator delete(p);
}
}
//------------------------------chop-------------------------------------------
Chunk *k = this;
while( k ) {
// clear out this chunk (to detect allocation bugs)
free(k); // Free chunk (was malloc'd)
k = tmp;
}
}
}
//------------------------------Arena------------------------------------------
}
}
set_size_in_bytes(a->size_in_bytes());
}
//------------------------------used-------------------------------------------
// Total of all Chunks in arena
while( k != _chunk) { // Whilst have Chunks in a row
k = k->_next; // Bump along to next Chunk
}
return sum; // Return total consumed space.
}
//------------------------------grow-------------------------------------------
// Grow a new Chunk
// Get minimal required size. Either real big, or even bigger for giant objs
_hwm += x;
return result;
}
//------------------------------calloc-----------------------------------------
// Allocate zeroed storage in Arena
return ptr; // Return space
}
//------------------------------realloc----------------------------------------
// Reallocate storage in Arena.
// Stupid fast special case
return c_old;
}
// See if we can resize in-place
return c_old; // Return old pointer
}
// Oops, got to relocate guts
return new_ptr;
}
//------------------------------reset------------------------------------------
// Reset this Arena to empty, and return this Arenas guts in a new Arena.
return a; // Return Arena with guts
}
//------------------------------contains---------------------------------------
// Determine if pointer belongs to this Arena or not.
return true; // Check for in this chunk
return true; // Check for every chunk in Arena
return false; // Not in any Chunk, so not in Arena
}
//-----------------------------------------------------------------------------
// CHeapObj
}
void CHeapObj::operator delete(void* p){
free(p);
}