aboutsummaryrefslogtreecommitdiff
path: root/lmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'lmem.h')
-rw-r--r--lmem.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lmem.h b/lmem.h
index d1abcbb4..74f236cd 100644
--- a/lmem.h
+++ b/lmem.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmem.h,v 1.33 2007/02/09 13:04:52 roberto Exp roberto $ 2** $Id: lmem.h,v 1.34 2009/04/17 14:40:13 roberto Exp roberto $
3** Interface to Memory Manager 3** Interface to Memory Manager
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -25,11 +25,13 @@
25#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) 25#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
26#define luaM_freearray(L, b, n) luaM_reallocv(L, (b), n, 0, sizeof((b)[0])) 26#define luaM_freearray(L, b, n) luaM_reallocv(L, (b), n, 0, sizeof((b)[0]))
27 27
28#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) 28#define luaM_malloc(L,s) luaM_realloc_(L, NULL, 0, (s))
29#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) 29#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
30#define luaM_newvector(L,n,t) \ 30#define luaM_newvector(L,n,t) \
31 cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) 31 cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
32 32
33#define luaM_newobject(L,tag,s) luaM_realloc_(L, NULL, tag, (s))
34
33#define luaM_growvector(L,v,nelems,size,t,limit,e) \ 35#define luaM_growvector(L,v,nelems,size,t,limit,e) \
34 if ((nelems)+1 > (size)) \ 36 if ((nelems)+1 > (size)) \
35 ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) 37 ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))