1879N/A * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A//------------------------------chop------------------------------------------- 0N/A // clear out this chunk (to detect allocation bugs) 0N/A free(k);
// Free chunk (was malloc'd) 0N/A//------------------------------Arena------------------------------------------ 0N/A//------------------------------used------------------------------------------- 0N/A// Total of all Chunks in arena 0N/A while( k !=
_chunk) {
// Whilst have Chunks in a row 0N/A k = k->
_next;
// Bump along to next Chunk 0N/A return sum;
// Return total consumed space. 0N/A//------------------------------grow------------------------------------------- 0N/A // Get minimal required size. Either real big, or even bigger for giant objs 0N/A//------------------------------calloc----------------------------------------- 0N/A// Allocate zeroed storage in Arena 0N/A//------------------------------realloc---------------------------------------- 0N/A// Reallocate storage in Arena. 0N/A // Stupid fast special case 0N/A // See if we can resize in-place 0N/A // Oops, got to relocate guts 0N/A//------------------------------reset------------------------------------------ 0N/A// Reset this Arena to empty, and return this Arenas guts in a new Arena. 0N/A return a;
// Return Arena with guts 0N/A//------------------------------contains--------------------------------------- 0N/A// Determine if pointer belongs to this Arena or not. 0N/A return true;
// Check for in this chunk 0N/A return true;
// Check for every chunk in Arena 0N/A return false;
// Not in any Chunk, so not in Arena 0N/A//-----------------------------------------------------------------------------