ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lmem.h
1 /*
2 ** Interface to Memory Manager
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef GRIM_LMEM_H
7 #define GRIM_LMEM_H
8 
9 #include "common/scummsys.h"
10 
11 namespace Grim {
12 
13 // memory error messages
14 #define codeEM "code size overflow"
15 #define constantEM "constant table overflow"
16 #define refEM "reference table overflow"
17 #define tableEM "table overflow"
18 #define memEM "not enough memory"
19 
20 void *luaM_realloc (void *oldblock, int32 size);
21 int32 luaM_growaux (void **block, int32 nelems, int32 size, const char *errormsg, int32 limit);
22 
23 #define luaM_free(b) free((b))
24 #define luaM_malloc(t) malloc((t))
25 #define luaM_new(t) ((t *)malloc(sizeof(t)))
26 #define luaM_newvector(n, t) ((t *)malloc((n) * sizeof(t)))
27 #define luaM_growvector(old, n, t, e, l) (luaM_growaux((void **)old, n, sizeof(t), e, l))
28 #define luaM_reallocvector(v, n, t) ((t *)realloc(v,(n) * sizeof(t)))
29 
30 #ifdef LUA_DEBUG
31 extern int32 numblocks;
32 extern int32 totalmem;
33 #endif
34 
35 } // end of namespace Grim
36 
37 #endif
38 
Definition: actor.h:33