2 ** $Id: lmem.h,v 1.5 1997/12/17 20:48:58 roberto Exp $
3 ** Interface to Memory Manager
4 ** See Copyright Notice in lua.h
16 /* memory error messages */
17 #define codeEM "code size overflow"
18 #define constantEM "constant table overflow"
19 #define refEM "reference table overflow"
20 #define tableEM "table overflow"
21 #define memEM "not enough memory"
23 void *luaM_realloc (void *oldblock
, unsigned long size
);
24 int luaM_growaux (void **block
, unsigned long nelems
, int size
,
25 char *errormsg
, unsigned long limit
);
27 #define luaM_free(b) luaM_realloc((b), 0)
28 #define luaM_malloc(t) luaM_realloc(NULL, (t))
29 #define luaM_new(t) ((t *)luaM_malloc(sizeof(t)))
30 #define luaM_newvector(n,t) ((t *)luaM_malloc((n)*sizeof(t)))
31 #define luaM_growvector(old,n,t,e,l) \
32 (luaM_growaux((void**)old,n,sizeof(t),e,l))
33 #define luaM_reallocvector(v,n,t) ((t *)luaM_realloc(v,(n)*sizeof(t)))
37 extern unsigned long numblocks
;
38 extern unsigned long totalmem
;