lua/luamem.h

40 lines
1.0 KiB
C
Raw Normal View History

1994-11-16 20:39:16 +03:00
/*
** mem.c
** memory manager for lua
** $Id: mem.h,v 1.7 1996/04/22 18:00:37 roberto Exp roberto $
1994-11-16 20:39:16 +03:00
*/
#ifndef mem_h
#define mem_h
#ifndef NULL
#define NULL 0
#endif
1996-03-21 19:33:47 +03:00
/* memory error messages */
#define codeEM "code size overflow"
#define symbolEM "symbol table overflow"
#define constantEM "constant table overflow"
#define stackEM "stack size overflow"
#define lexEM "lex buffer overflow"
#define refEM "reference table overflow"
#define tableEM "table overflow"
#define memEM "not enough memory"
1996-03-21 19:33:47 +03:00
1994-11-16 20:39:16 +03:00
void luaI_free (void *block);
void *luaI_realloc (void *oldblock, unsigned long size);
1996-03-21 19:33:47 +03:00
void *luaI_buffer (unsigned long size);
int luaI_growvector (void **block, unsigned long nelems, int size,
char *errormsg, unsigned long limit);
1994-11-16 20:39:16 +03:00
#define luaI_malloc(s) luaI_realloc(NULL, (s))
1994-11-16 20:39:16 +03:00
#define new(s) ((s *)luaI_malloc(sizeof(s)))
#define newvector(n,s) ((s *)luaI_malloc((n)*sizeof(s)))
1996-03-21 19:33:47 +03:00
#define growvector(old,n,s,e,l) \
(luaI_growvector((void**)old,n,sizeof(s),e,l))
1994-11-16 20:39:16 +03:00
#endif