lua

A copy of the Lua development repository
Log | Files | Refs | README

commit b51d76ce8dfeb1dd3cc3e69b32cf665ff32ff26e
parent 95020afb6385f3c1293118c4950e9fb6299cef5a
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue, 17 Nov 2009 09:55:39 -0200

when doing hard memory tests, perform a full GC at every possible step

Diffstat:
Mlgc.h | 4++--
Mllimits.h | 8+++++++-
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lgc.h b/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.20 2009/04/28 19:04:36 roberto Exp roberto $ +** $Id: lgc.h,v 2.21 2009/06/08 19:35:59 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -79,7 +79,7 @@ #define luaC_checkGC(L) \ - {condmovestack(L); if (G(L)->totalbytes >= G(L)->GCthreshold) luaC_step(L);} + {condchangemem(L); if (G(L)->totalbytes >= G(L)->GCthreshold) luaC_step(L);} #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ diff --git a/llimits.h b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.73 2009/07/15 17:26:14 roberto Exp roberto $ +** $Id: llimits.h,v 1.74 2009/08/31 14:26:28 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -128,4 +128,10 @@ typedef lu_int32 Instruction; #define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) #endif +#if !defined(HARDMEMTESTS) +#define condchangemem(L) condmovestack(L) +#else +#define condchangemem(L) luaC_fullgc(L, 0) +#endif + #endif