diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-17 11:40:13 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-17 11:40:13 -0300 |
commit | c6b442bd369ce05b3d4bfb95ba64451521aa1b31 (patch) | |
tree | f46b96d8142564c05ad89400bb203510b71cb2b2 | |
parent | 4f88418170d298b065a7f71d86b1127153919ae9 (diff) | |
download | lua-c6b442bd369ce05b3d4bfb95ba64451521aa1b31.tar.gz lua-c6b442bd369ce05b3d4bfb95ba64451521aa1b31.tar.bz2 lua-c6b442bd369ce05b3d4bfb95ba64451521aa1b31.zip |
'luaM_freearray' does not need array type as argument
-rw-r--r-- | lfunc.c | 14 | ||||
-rw-r--r-- | lmem.h | 4 | ||||
-rw-r--r-- | lstate.c | 6 | ||||
-rw-r--r-- | lstring.c | 4 | ||||
-rw-r--r-- | ltable.c | 8 |
5 files changed, 18 insertions, 18 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 2.12 2005/12/22 16:19:56 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.13 2007/02/07 17:48:52 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -139,12 +139,12 @@ Proto *luaF_newproto (lua_State *L) { | |||
139 | 139 | ||
140 | 140 | ||
141 | void luaF_freeproto (lua_State *L, Proto *f) { | 141 | void luaF_freeproto (lua_State *L, Proto *f) { |
142 | luaM_freearray(L, f->code, f->sizecode, Instruction); | 142 | luaM_freearray(L, f->code, f->sizecode); |
143 | luaM_freearray(L, f->p, f->sizep, Proto *); | 143 | luaM_freearray(L, f->p, f->sizep); |
144 | luaM_freearray(L, f->k, f->sizek, TValue); | 144 | luaM_freearray(L, f->k, f->sizek); |
145 | luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); | 145 | luaM_freearray(L, f->lineinfo, f->sizelineinfo); |
146 | luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); | 146 | luaM_freearray(L, f->locvars, f->sizelocvars); |
147 | luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); | 147 | luaM_freearray(L, f->upvalues, f->sizeupvalues); |
148 | luaM_free(L, f); | 148 | luaM_free(L, f); |
149 | } | 149 | } |
150 | 150 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmem.h,v 1.32 2006/09/14 18:42:28 roberto Exp roberto $ | 2 | ** $Id: lmem.h,v 1.33 2007/02/09 13:04:52 roberto Exp roberto $ |
3 | ** Interface to Memory Manager | 3 | ** Interface to Memory Manager |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) | 24 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) |
25 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) | 25 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) |
26 | #define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) | 26 | #define luaM_freearray(L, b, n) luaM_reallocv(L, (b), n, 0, sizeof((b)[0])) |
27 | 27 | ||
28 | #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) | 28 | #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) |
29 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) | 29 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.50 2009/03/10 17:14:37 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.51 2009/04/17 14:28:06 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -93,7 +93,7 @@ static void freestack (lua_State *L) { | |||
93 | L->ci = &L->base_ci; /* reset 'ci' list */ | 93 | L->ci = &L->base_ci; /* reset 'ci' list */ |
94 | luaE_freeCI(L); | 94 | luaE_freeCI(L); |
95 | lua_assert(L->nci == 0); | 95 | lua_assert(L->nci == 0); |
96 | luaM_freearray(L, L->stack, L->stacksize, TValue); | 96 | luaM_freearray(L, L->stack, L->stacksize); |
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
@@ -140,7 +140,7 @@ static void close_state (lua_State *L) { | |||
140 | global_State *g = G(L); | 140 | global_State *g = G(L); |
141 | luaF_close(L, L->stack); /* close all upvalues for this thread */ | 141 | luaF_close(L, L->stack); /* close all upvalues for this thread */ |
142 | luaC_freeall(L); /* collect all objects */ | 142 | luaC_freeall(L); /* collect all objects */ |
143 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); | 143 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); |
144 | luaZ_freebuffer(L, &g->buff); | 144 | luaZ_freebuffer(L, &g->buff); |
145 | freestack(L); | 145 | freestack(L); |
146 | lua_assert(g->totalbytes == sizeof(LG)); | 146 | lua_assert(g->totalbytes == sizeof(LG)); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 2.10 2007/11/09 18:55:07 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.11 2008/02/19 18:55:09 roberto Exp roberto $ |
3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -41,7 +41,7 @@ void luaS_resize (lua_State *L, int newsize) { | |||
41 | p = next; | 41 | p = next; |
42 | } | 42 | } |
43 | } | 43 | } |
44 | luaM_freearray(L, tb->hash, tb->size, TString *); | 44 | luaM_freearray(L, tb->hash, tb->size); |
45 | tb->size = newsize; | 45 | tb->size = newsize; |
46 | tb->hash = newhash; | 46 | tb->hash = newhash; |
47 | } | 47 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.38 2008/01/30 18:05:23 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.39 2009/03/30 18:38:24 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -320,7 +320,7 @@ void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { | |||
320 | setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old)); | 320 | setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old)); |
321 | } | 321 | } |
322 | if (nold != dummynode) | 322 | if (nold != dummynode) |
323 | luaM_freearray(L, nold, twoto(oldhsize), Node); /* free old array */ | 323 | luaM_freearray(L, nold, twoto(oldhsize)); /* free old array */ |
324 | } | 324 | } |
325 | 325 | ||
326 | 326 | ||
@@ -369,8 +369,8 @@ Table *luaH_new (lua_State *L) { | |||
369 | 369 | ||
370 | void luaH_free (lua_State *L, Table *t) { | 370 | void luaH_free (lua_State *L, Table *t) { |
371 | if (t->node != dummynode) | 371 | if (t->node != dummynode) |
372 | luaM_freearray(L, t->node, sizenode(t), Node); | 372 | luaM_freearray(L, t->node, sizenode(t)); |
373 | luaM_freearray(L, t->array, t->sizearray, TValue); | 373 | luaM_freearray(L, t->array, t->sizearray); |
374 | luaM_free(L, t); | 374 | luaM_free(L, t); |
375 | } | 375 | } |
376 | 376 | ||