added LUAI_FUNC to functions not in the API

This commit is contained in:
Roberto Ierusalimschy
2005-04-25 16:24:10 -03:00
parent 8c3c3e7691
commit 8718fda9b2
18 changed files with 180 additions and 161 deletions

17
lmem.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: lmem.h,v 1.29 2004/12/01 15:46:18 roberto Exp roberto $
** $Id: lmem.h,v 1.30 2005/03/18 16:38:02 roberto Exp roberto $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@@ -16,19 +16,11 @@
#define MEMERRMSG "not enough memory"
void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, size_t size);
void *luaM_toobig (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) \
((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
luaM_toobig(L))
void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elem,
int limit, const char *errormsg);
#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t))
@@ -46,5 +38,12 @@ void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elem,
((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
size_t size);
LUAI_FUNC void *luaM_toobig (lua_State *L);
LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
size_t size_elem, int limit,
const char *errormsg);
#endif