From 4ac58853dc820127a11a14ed8bde1fae9458369e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 19 Jan 2001 11:20:30 -0200 Subject: thead-specific state separated from "global" state --- lmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lmem.c') diff --git a/lmem.c b/lmem.c index 3d34e313..0756fe91 100644 --- a/lmem.c +++ b/lmem.c @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.41 2000/12/26 18:46:09 roberto Exp roberto $ +** $Id: lmem.c,v 1.42 2000/12/28 12:55:41 roberto Exp roberto $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ @@ -161,9 +161,9 @@ void *luaM_realloc (lua_State *L, void *block, luint32 oldsize, luint32 size) { else return NULL; /* error before creating state! */ } } - if (L) { - L->nblocks -= oldsize; - L->nblocks += size; + if (L && G(L)) { + G(L)->nblocks -= oldsize; + G(L)->nblocks += size; } return block; } -- cgit v1.2.3-55-g6feb