* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
* mLib 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 Library General Public License for more details.
* mLib 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 Library General Public License for more details.
* You should have received a copy of the GNU Library General Public
* License along with mLib; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
* You should have received a copy of the GNU Library General Public
* License along with mLib; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#include "arena.h"
/*----- The standard arena ------------------------------------------------*/
static void *_alloc(arena *a, size_t sz) { return malloc(sz); }
#include "arena.h"
/*----- The standard arena ------------------------------------------------*/
static void *_alloc(arena *a, size_t sz) { return malloc(sz); }
-static void *_realloc(arena *a, void *p, size_t sz){ return realloc(p, sz); }
-static void _free(arena *a, void *p) { free (p); }
+static void *_realloc(arena *a, void *p, size_t sz, size_t osz)
+ { return realloc(p, sz); }
+static void _free(arena *a, void *p) { free(p); }
static arena_ops stdlib_ops = { _alloc, _realloc, _free, 0 };
arena arena_stdlib = { &stdlib_ops };
static arena_ops stdlib_ops = { _alloc, _realloc, _free, 0 };
arena arena_stdlib = { &stdlib_ops };
* Arguments: @arena *a@ = pointer to arena block
* @void *p@ = pointer to memory block to resize
* @size_t sz@ = size desired for the block
* Arguments: @arena *a@ = pointer to arena block
* @void *p@ = pointer to memory block to resize
* @size_t sz@ = size desired for the block
-void *arena_fakerealloc(arena *a, void *p, size_t sz)
+void *arena_fakerealloc(arena *a, void *p, size_t sz, size_t osz)
/* --- Function equivalents of the macros --- */
void *a_alloc(arena *a, size_t sz) { return (A_ALLOC(a, sz)); }
/* --- Function equivalents of the macros --- */
void *a_alloc(arena *a, size_t sz) { return (A_ALLOC(a, sz)); }
-void *a_realloc(arena *a, void *p, size_t sz) { return A_REALLOC(a, p, sz); }
+void *a_realloc(arena *a, void *p, size_t sz, size_t osz)
+{ return A_REALLOC(a, p, sz, osz); }
void a_free(arena *a, void *p) { A_FREE(a, p); }
/*----- That's all, folks -------------------------------------------------*/
void a_free(arena *a, void *p) { A_FREE(a, p); }
/*----- That's all, folks -------------------------------------------------*/