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