From 26d1e21c89a481c2368ba934da8e192a164d8f99 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 25 Feb 1999 12:16:26 -0300 Subject: new way to handle "growing" vectors --- lmem.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lmem.h') diff --git a/lmem.h b/lmem.h index 4741b7f6..c8e015d6 100644 --- a/lmem.h +++ b/lmem.h @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.5 1997/12/17 20:48:58 roberto Exp roberto $ +** $Id: lmem.h,v 1.6 1998/12/15 14:59:43 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -18,15 +18,15 @@ #define memEM "not enough memory" void *luaM_realloc (void *oldblock, unsigned long size); -int luaM_growaux (void **block, unsigned long nelems, int size, +void *luaM_growaux (void *block, unsigned long nelems, int inc, int size, char *errormsg, unsigned long limit); #define luaM_free(b) luaM_realloc((b), 0) #define luaM_malloc(t) luaM_realloc(NULL, (t)) #define luaM_new(t) ((t *)luaM_malloc(sizeof(t))) #define luaM_newvector(n,t) ((t *)luaM_malloc((n)*sizeof(t))) -#define luaM_growvector(old,n,t,e,l) \ - (luaM_growaux((void**)old,n,sizeof(t),e,l)) +#define luaM_growvector(old,nelems,inc,t,e,l) \ + ((t *)luaM_growaux(old,nelems,inc,sizeof(t),e,l)) #define luaM_reallocvector(v,n,t) ((t *)luaM_realloc(v,(n)*sizeof(t))) -- cgit v1.2.3-55-g6feb