From dd373a8f665e5e22ad3ad75401aa9fe3bbb2afc8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 11 Sep 2013 11:09:55 -0300 Subject: threads are kept in a separated GC list, linked after the main thread --- lstate.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 40a23643..fc8f775d 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.93 2013/09/03 15:37:10 roberto Exp roberto $ +** $Id: lstate.h,v 2.94 2013/09/05 19:31:49 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -16,20 +16,19 @@ /* -** Some notes about garbage-collected objects: All objects in Lua must -** be kept somehow accessible until being freed. +** Some notes about garbage-collected objects: All objects in Lua must +** be kept somehow accessible until being freed, so all objects always +** belong to one (and only one) of these lists, using field 'next' of +** the 'CommonHeader' for the link: ** -** Lua keeps most objects linked in list g->allgc. The link uses field -** 'next' of the CommonHeader. Threads (except the main one) ar kept -** at the end of the 'allgc' list, after the 'l_registry' (which is -** the first object to be added to the list). -** -** List 'fixedgc' keep objects that are not to be collected (currently +** mainthread->next: all threads; +** localgc: all local objects not marked for finalization; +** localfin: all local objects marked for finalization; +** allgc: all non local objects not marked for finalization; +** finobj: all non local objects marked for finalization; +** tobefnz: all objects ready to be finalized; +** fixedgc: all objects that are not to be collected (currently ** only small strings, such as reserved words). -** -** Live objects with finalizers are kept in the list g->finobj. The -** list g->tobefnz links all objects being finalized. In particular, an -** object has its FINALIZEDBIT set iff it is in one of these lists. */ -- cgit v1.2.3-55-g6feb