diff options
Diffstat (limited to 'src/lj_tab.c')
-rw-r--r-- | src/lj_tab.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lj_tab.c b/src/lj_tab.c index 830e3023..cd200f02 100644 --- a/src/lj_tab.c +++ b/src/lj_tab.c | |||
@@ -97,7 +97,7 @@ static GCtab *newtab(lua_State *L, uint32_t asize, uint32_t hbits) | |||
97 | { | 97 | { |
98 | GCtab *t; | 98 | GCtab *t; |
99 | /* First try to colocate the array part. */ | 99 | /* First try to colocate the array part. */ |
100 | if (LJ_MAX_COLOSIZE && asize > 0 && asize <= LJ_MAX_COLOSIZE) { | 100 | if (LJ_MAX_COLOSIZE != 0 && asize > 0 && asize <= LJ_MAX_COLOSIZE) { |
101 | lua_assert((sizeof(GCtab) & 7) == 0); | 101 | lua_assert((sizeof(GCtab) & 7) == 0); |
102 | t = (GCtab *)lj_mem_newgco(L, sizetabcolo(asize)); | 102 | t = (GCtab *)lj_mem_newgco(L, sizetabcolo(asize)); |
103 | t->gct = ~LJ_TTAB; | 103 | t->gct = ~LJ_TTAB; |
@@ -203,9 +203,9 @@ void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t) | |||
203 | { | 203 | { |
204 | if (t->hmask > 0) | 204 | if (t->hmask > 0) |
205 | lj_mem_freevec(g, noderef(t->node), t->hmask+1, Node); | 205 | lj_mem_freevec(g, noderef(t->node), t->hmask+1, Node); |
206 | if (t->asize > 0 && LJ_MAX_COLOSIZE && t->colo <= 0) | 206 | if (t->asize > 0 && LJ_MAX_COLOSIZE != 0 && t->colo <= 0) |
207 | lj_mem_freevec(g, tvref(t->array), t->asize, TValue); | 207 | lj_mem_freevec(g, tvref(t->array), t->asize, TValue); |
208 | if (LJ_MAX_COLOSIZE && t->colo) | 208 | if (LJ_MAX_COLOSIZE != 0 && t->colo) |
209 | lj_mem_free(g, t, sizetabcolo((uint32_t)t->colo & 0x7f)); | 209 | lj_mem_free(g, t, sizetabcolo((uint32_t)t->colo & 0x7f)); |
210 | else | 210 | else |
211 | lj_mem_freet(g, t); | 211 | lj_mem_freet(g, t); |
@@ -224,7 +224,7 @@ static void resizetab(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits) | |||
224 | uint32_t i; | 224 | uint32_t i; |
225 | if (asize > LJ_MAX_ASIZE) | 225 | if (asize > LJ_MAX_ASIZE) |
226 | lj_err_msg(L, LJ_ERR_TABOV); | 226 | lj_err_msg(L, LJ_ERR_TABOV); |
227 | if (LJ_MAX_COLOSIZE && t->colo > 0) { | 227 | if (LJ_MAX_COLOSIZE != 0 && t->colo > 0) { |
228 | /* A colocated array must be separated and copied. */ | 228 | /* A colocated array must be separated and copied. */ |
229 | TValue *oarray = tvref(t->array); | 229 | TValue *oarray = tvref(t->array); |
230 | array = lj_mem_newvec(L, asize, TValue); | 230 | array = lj_mem_newvec(L, asize, TValue); |
@@ -257,7 +257,7 @@ static void resizetab(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits) | |||
257 | if (!tvisnil(&array[i])) | 257 | if (!tvisnil(&array[i])) |
258 | copyTV(L, lj_tab_setinth(L, t, (int32_t)i), &array[i]); | 258 | copyTV(L, lj_tab_setinth(L, t, (int32_t)i), &array[i]); |
259 | /* Physically shrink only separated arrays. */ | 259 | /* Physically shrink only separated arrays. */ |
260 | if (LJ_MAX_COLOSIZE && t->colo <= 0) | 260 | if (LJ_MAX_COLOSIZE != 0 && t->colo <= 0) |
261 | setmref(t->array, lj_mem_realloc(L, array, | 261 | setmref(t->array, lj_mem_realloc(L, array, |
262 | oldasize*sizeof(TValue), asize*sizeof(TValue))); | 262 | oldasize*sizeof(TValue), asize*sizeof(TValue))); |
263 | } | 263 | } |