ways to measure number of `blocks' for GC + details

This commit is contained in:
Roberto Ierusalimschy
1999-11-10 13:39:35 -02:00
parent 53fb65d394
commit d915cf4f9d
6 changed files with 35 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstate.c,v 1.14 1999/10/04 17:51:04 roberto Exp $
** $Id: lstate.c,v 1.15 1999/10/14 17:53:35 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -10,6 +10,7 @@
#include "lgc.h"
#include "llex.h"
#include "lmem.h"
#include "lref.h"
#include "lstate.h"
#include "lstring.h"
#include "ltm.h"
@@ -41,13 +42,15 @@ void lua_open (void) {
L->IMtable = NULL;
L->refArray = NULL;
L->refSize = 0;
L->GCthreshold = GARBAGE_BLOCK;
L->refFree = NONEXT;
L->nblocks = 0;
L->GCthreshold = MAX_INT; /* to avoid GC during pre-definitions */
luaD_init();
luaS_init();
luaX_init();
luaT_init();
luaB_predefine();
L->GCthreshold = L->nblocks*4;
}
@@ -70,4 +73,3 @@ void lua_close (void) {
L = NULL;
}