From 0ffc676ce7ea4764f3277ce87967ef14ad323933 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 11 Oct 2000 14:47:50 -0200 Subject: details --- lmem.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'lmem.c') diff --git a/lmem.c b/lmem.c index 9841092a..bd6b58da 100644 --- a/lmem.c +++ b/lmem.c @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.35 2000/08/04 19:38:35 roberto Exp roberto $ +** $Id: lmem.c,v 1.36 2000/08/09 19:16:57 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -15,15 +15,6 @@ #include "lstate.h" -/* -** Real ISO (ANSI) systems do not need these tests; -** but some systems (Sun OS) are not that ISO... -*/ -#ifdef OLD_ANSI -#define realloc(b,s) ((b) == NULL ? malloc(s) : (realloc)(b, s)) -#define free(b) if (b) (free)(b) -#endif - #ifdef DEBUG @@ -38,11 +29,8 @@ #include #include -#undef realloc -#undef malloc -#undef free #define realloc(b, s) debug_realloc(b, s) -#define malloc(b) debug_realloc(NULL, 0) +#define malloc(b) debug_realloc(NULL, b) #define free(b) debug_realloc(b, 0) @@ -119,6 +107,16 @@ static void *debug_realloc (void *block, size_t size) { +/* +** Real ISO (ANSI) systems do not need these tests; +** but some systems (Sun OS) are not that ISO... +*/ +#ifdef OLD_ANSI +#define realloc(b,s) ((b) == NULL ? malloc(s) : (realloc)(b, s)) +#define free(b) if (b) (free)(b) +#endif + + void *luaM_growaux (lua_State *L, void *block, size_t nelems, int inc, size_t size, const char *errormsg, size_t limit) { size_t newn = nelems+inc; -- cgit v1.2.3-55-g6feb