definition of 'GCSTEPSIZE' moved to header file + small changes
This commit is contained in:
7
lgc.c
7
lgc.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lgc.c,v 2.126 2012/05/22 17:50:39 roberto Exp roberto $
|
** $Id: lgc.c,v 2.127 2012/05/22 18:38:56 roberto Exp roberto $
|
||||||
** Garbage Collector
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -24,11 +24,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* how much to allocate before next GC step */
|
|
||||||
#define GCSTEPSIZE (cast_int(256 * sizeof(void*)))
|
|
||||||
|
|
||||||
/* cost of sweeping one element (half the size of a small object) */
|
/* cost of sweeping one element (half the size of a small object) */
|
||||||
#define GCSWEEPCOST ((sizeof(TString) + 2) / 2)
|
#define GCSWEEPCOST ((sizeof(TString) + 4) / 2)
|
||||||
|
|
||||||
/* maximum number of elements to sweep in each single step */
|
/* maximum number of elements to sweep in each single step */
|
||||||
#define GCSWEEPMAX (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4))
|
#define GCSWEEPMAX (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4))
|
||||||
|
|||||||
16
lgc.h
16
lgc.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lgc.h,v 2.54 2012/05/11 19:22:33 roberto Exp roberto $
|
** $Id: lgc.h,v 2.55 2012/05/21 13:18:10 roberto Exp roberto $
|
||||||
** Garbage Collector
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -20,13 +20,19 @@
|
|||||||
** is that a black object can never point to a white one. Moreover,
|
** is that a black object can never point to a white one. Moreover,
|
||||||
** any gray object must be in a "gray list" (gray, grayagain, weak,
|
** any gray object must be in a "gray list" (gray, grayagain, weak,
|
||||||
** allweak, ephemeron) so that it can be visited again before finishing
|
** allweak, ephemeron) so that it can be visited again before finishing
|
||||||
** the collection cycle. (These rule does not apply to strings,
|
** the collection cycle. These lists have no meaning when the invariant
|
||||||
** which are never black but do not need to be visited again.)
|
** is not being enforced (e.g., sweep phase).
|
||||||
** These lists have no meaning when the invariant is not being enforced
|
|
||||||
** (e.g., sweep phase).
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* how much to allocate before next GC step */
|
||||||
|
#if !defined(GCSTEPSIZE)
|
||||||
|
/* ~100 small strings */
|
||||||
|
#define GCSTEPSIZE (cast_int(100 * sizeof(TString)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Possible states of the Garbage Collector
|
** Possible states of the Garbage Collector
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user