Go to the documentation of this file.
16 #define MEMERRMSG "not enough memory"
25 int limit,
const char *errormsg)
28 #define luaM_free(L, b, s) luaM_realloc(L, (b), (s), 0)
29 #define luaM_freelem(L, b) luaM_realloc(L, (b), sizeof(*(b)), 0)
30 #define luaM_freearray(L, b, n, t) luaM_realloc(L, (b), \
31 cast(lu_mem, n)*cast(lu_mem, sizeof(t)), 0)
33 #define luaM_malloc(L, t) luaM_realloc(L, NULL, 0, (t))
34 #define luaM_new(L, t) cast(t *, luaM_malloc(L, sizeof(t)))
35 #define luaM_newvector(L, n,t) cast(t *, luaM_malloc(L, \
36 cast(lu_mem, n)*cast(lu_mem, sizeof(t))))
38 #define luaM_growvector(L,v,nelems,size,t,limit,e) \
39 if (((nelems)+1) > (size)) \
40 ((v)=cast(t *, luaM_growaux(L,v,&(size),sizeof(t),limit,e)))
42 #define luaM_reallocvector(L, v,oldn,n,t) \
43 ((v)=cast(t *, luaM_realloc(L, v,cast(lu_mem, oldn)*cast(lu_mem, sizeof(t)), \
44 cast(lu_mem, n)*cast(lu_mem, sizeof(t)))))