From 0bbdddc86b1353fec36ae886b4142986f3c4713f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 17 Dec 2009 13:46:44 -0200 Subject: allocator function receives the tag of object being allocated in 'osize' when 'ptr' is NULL. --- lmem.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lmem.h') diff --git a/lmem.h b/lmem.h index d1abcbb4..74f236cd 100644 --- a/lmem.h +++ b/lmem.h @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.33 2007/02/09 13:04:52 roberto Exp roberto $ +** $Id: lmem.h,v 1.34 2009/04/17 14:40:13 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -25,11 +25,13 @@ #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) #define luaM_freearray(L, b, n) luaM_reallocv(L, (b), n, 0, sizeof((b)[0])) -#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) +#define luaM_malloc(L,s) luaM_realloc_(L, NULL, 0, (s)) #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) #define luaM_newvector(L,n,t) \ cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) +#define luaM_newobject(L,tag,s) luaM_realloc_(L, NULL, tag, (s)) + #define luaM_growvector(L,v,nelems,size,t,limit,e) \ if ((nelems)+1 > (size)) \ ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) -- cgit v1.2.3-55-g6feb