better definition for `luaM_freelem'
This commit is contained in:
2
lmem.h
2
lmem.h
@@ -19,7 +19,7 @@ void *luaM_growaux (lua_State *L, void *block, int *size, int size_elem,
|
|||||||
int limit, const l_char *errormsg);
|
int limit, const l_char *errormsg);
|
||||||
|
|
||||||
#define luaM_free(L, b, s) luaM_realloc(L, (b), (s), 0)
|
#define luaM_free(L, b, s) luaM_realloc(L, (b), (s), 0)
|
||||||
#define luaM_freelem(L, b, t) luaM_realloc(L, (b), sizeof(t), 0)
|
#define luaM_freelem(L, b) luaM_realloc(L, (b), sizeof(*(b)), 0)
|
||||||
#define luaM_freearray(L, b, n, t) luaM_realloc(L, (b), \
|
#define luaM_freearray(L, b, n, t) luaM_realloc(L, (b), \
|
||||||
cast(lu_mem, n)*cast(lu_mem, sizeof(t)), 0)
|
cast(lu_mem, n)*cast(lu_mem, sizeof(t)), 0)
|
||||||
|
|
||||||
|
|||||||
2
ltable.c
2
ltable.c
@@ -127,7 +127,7 @@ Hash *luaH_new (lua_State *L, int size) {
|
|||||||
|
|
||||||
void luaH_free (lua_State *L, Hash *t) {
|
void luaH_free (lua_State *L, Hash *t) {
|
||||||
luaM_freearray(L, t->node, t->size, Node);
|
luaM_freearray(L, t->node, t->size, Node);
|
||||||
luaM_freelem(L, t, Hash);
|
luaM_freelem(L, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user