aboutsummaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-09-11 11:09:55 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-09-11 11:09:55 -0300
commitdd373a8f665e5e22ad3ad75401aa9fe3bbb2afc8 (patch)
treed475246f43edc6de6e1ebf491b274e9d9a5c1c24 /lstate.h
parent7061fe1d56f40e9d22a226423079da808fb41f66 (diff)
downloadlua-dd373a8f665e5e22ad3ad75401aa9fe3bbb2afc8.tar.gz
lua-dd373a8f665e5e22ad3ad75401aa9fe3bbb2afc8.tar.bz2
lua-dd373a8f665e5e22ad3ad75401aa9fe3bbb2afc8.zip
threads are kept in a separated GC list, linked after the main thread
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/lstate.h b/lstate.h
index 40a23643..fc8f775d 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 2.93 2013/09/03 15:37:10 roberto Exp roberto $ 2** $Id: lstate.h,v 2.94 2013/09/05 19:31:49 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -16,20 +16,19 @@
16 16
17/* 17/*
18 18
19** Some notes about garbage-collected objects: All objects in Lua must 19** Some notes about garbage-collected objects: All objects in Lua must
20** be kept somehow accessible until being freed. 20** be kept somehow accessible until being freed, so all objects always
21** belong to one (and only one) of these lists, using field 'next' of
22** the 'CommonHeader' for the link:
21** 23**
22** Lua keeps most objects linked in list g->allgc. The link uses field 24** mainthread->next: all threads;
23** 'next' of the CommonHeader. Threads (except the main one) ar kept 25** localgc: all local objects not marked for finalization;
24** at the end of the 'allgc' list, after the 'l_registry' (which is 26** localfin: all local objects marked for finalization;
25** the first object to be added to the list). 27** allgc: all non local objects not marked for finalization;
26** 28** finobj: all non local objects marked for finalization;
27** List 'fixedgc' keep objects that are not to be collected (currently 29** tobefnz: all objects ready to be finalized;
30** fixedgc: all objects that are not to be collected (currently
28** only small strings, such as reserved words). 31** only small strings, such as reserved words).
29**
30** Live objects with finalizers are kept in the list g->finobj. The
31** list g->tobefnz links all objects being finalized. In particular, an
32** object has its FINALIZEDBIT set iff it is in one of these lists.
33 32
34*/ 33*/
35 34