aboutsummaryrefslogtreecommitdiff
path: root/lmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'lmem.c')
-rw-r--r--lmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lmem.c b/lmem.c
index 7caa0f3e..47c45156 100644
--- a/lmem.c
+++ b/lmem.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmem.c,v 1.20 1999/11/22 13:12:07 roberto Exp roberto $ 2** $Id: lmem.c,v 1.21 1999/11/29 16:38:48 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*/
@@ -31,10 +31,10 @@ void *luaM_growaux (lua_State *L, void *block, unsigned long nelems,
31 int inc, int size, const char *errormsg, unsigned long limit) { 31 int inc, int size, const char *errormsg, unsigned long limit) {
32 unsigned long newn = nelems+inc; 32 unsigned long newn = nelems+inc;
33 if (newn >= limit) lua_error(L, errormsg); 33 if (newn >= limit) lua_error(L, errormsg);
34 if ((newn ^ nelems) <= nelems || /* still the same power of 2 limit? */ 34 if ((newn ^ nelems) <= nelems || /* still the same power-of-2 limit? */
35 (nelems > 0 && newn < MINPOWER2)) /* or block already is MINPOWER2? */ 35 (nelems > 0 && newn < MINPOWER2)) /* or block already is MINPOWER2? */
36 return block; /* do not need to reallocate */ 36 return block; /* do not need to reallocate */
37 else /* it crossed a power of 2 boundary; grow to next power */ 37 else /* it crossed a power-of-2 boundary; grow to next power */
38 return luaM_realloc(L, block, luaO_power2(newn)*size); 38 return luaM_realloc(L, block, luaO_power2(newn)*size);
39} 39}
40 40