Commit Graph

161 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
9aec500a26 no need for field 'gch' anymore 2014-07-17 14:27:49 -03:00
Roberto Ierusalimschy
ed795d5ff4 detail (removed unused prototype) 2014-03-19 15:51:16 -03:00
Roberto Ierusalimschy
3f78de256e no need to keep threads in a different GC list, now that there is the
'twups' list
2014-02-18 10:46:26 -03:00
Roberto Ierusalimschy
1cce3e6842 change in the way 'collectgarbage("step", size)' interprets 'size'
(mimicking the way the GC itself behaves when Lua allocates 'size'
Kbytes)
2014-02-14 14:43:14 -02:00
Roberto Ierusalimschy
de3b1c9b53 better control for number of finalizers called at each GC cycle
(increases progressively)
2014-02-13 12:46:38 -02:00
Roberto Ierusalimschy
733c58595b no more local collection 2014-02-13 10:11:34 -02:00
Roberto Ierusalimschy
ba3586cc90 keep a single list of objects to be finalized (with local and non-local
objects), to ensure finalization order
2014-02-11 10:18:12 -02:00
Roberto Ierusalimschy
06156e7575 detail (setmetatable do not need to use a back GC barrier) 2013-09-11 17:15:31 -03:00
Roberto Ierusalimschy
4eeb1831be new names and better order for GC states (sweep first lists that
can have dead objects)
2013-09-11 11:47:08 -03:00
Roberto Ierusalimschy
dd373a8f66 threads are kept in a separated GC list, linked after the main thread 2013-09-11 11:09:55 -03:00
Roberto Ierusalimschy
d8aa8dd97e objects in list 'tobefnz' have a GC life-cycle like all others
(specifically they are cleaned during sweep phase)
2013-09-11 09:47:48 -03:00
Roberto Ierusalimschy
1150873447 'luaC_newobj' does not handle special cases; only special case
now is threads, which do not use 'luaC_newobj' anymore.
2013-09-11 09:26:14 -03:00
Roberto Ierusalimschy
aeff4f79fa local collection now calls finalizers 2013-09-03 12:37:10 -03:00
Roberto Ierusalimschy
1bf4faec64 new GC state to sweep 'localgc' list + small changes in sweep control 2013-08-30 16:14:26 -03:00
Roberto Ierusalimschy
26629d0af1 details (a few casts moved from macro invocation to macro definition) 2013-08-29 10:49:57 -03:00
Roberto Ierusalimschy
90972ff136 LOCALBLACK changed to LOCALMARK and used also to control whether object
is in 'localgc' list + luaC_newobj by default puts object in 'localgc'
list
2013-08-27 17:04:00 -03:00
Roberto Ierusalimschy
af35c7f398 upvalues collected by reference count 2013-08-27 15:53:35 -03:00
Roberto Ierusalimschy
50955e27f5 C functions and strings now go to the local list; first version
of the local collector
2013-08-23 10:34:54 -03:00
Roberto Ierusalimschy
0df6635711 "fixed" objects kept in a separated list (instead of being kept in
'allgc' list with a bit marking them)
2013-08-21 17:09:51 -03:00
Roberto Ierusalimschy
ae800656c9 change in string table: string table is now independent of GC lists; all
strings live in 'normal' GC lists
2013-08-21 16:21:16 -03:00
Roberto Ierusalimschy
8f6b80aa1d GC bits SEPARATED and FINALIZEDBIT mixed in FINALIZEDBIT (with simpler
control)
2013-08-20 14:46:34 -03:00
Roberto Ierusalimschy
9eff921f8f "barrier" for link prototype->cache changed to be consistent with
GC behavior (link is cleared to preserve invariant)
2013-08-19 11:18:43 -03:00
Roberto Ierusalimschy
439d74e29f added 'local' bit (true => object is only refered by local variables) 2013-08-16 15:55:49 -03:00
Roberto Ierusalimschy
3679d33b02 barrier conditions rewritten to test first 'isblack' and then 'iswhite'
(during a pause all objects are white, so 'isblack' fails much more
often than 'iswhite')
2013-08-13 14:36:44 -03:00
Roberto Ierusalimschy
677d90165f no more generational collection !!! 2013-08-05 13:58:28 -03:00
Roberto Ierusalimschy
ae1d318822 small bug: generational mode is always in 'propagate' mode only
outside the collector: during collection of course it must go to
other modes.
2012-09-11 09:53:08 -03:00
Roberto Ierusalimschy
e4f609d0ee collector in generational mode must be in 'propagate' state when
not running a collection
2012-07-04 12:52:38 -03:00
Roberto Ierusalimschy
e29f3a5751 definition of 'GCSTEPSIZE' moved to header file + small changes 2012-05-23 12:43:14 -03:00
Roberto Ierusalimschy
398811a313 simpler macro 'luaC_condGC' + better 'step' in 'lua_gc' +
micro bug in 'luaC_checkfinalizer' (current sweep object could be
removed from 'allgc' list)
2012-05-21 10:18:10 -03:00
Roberto Ierusalimschy
31829ad177 test for whether collector is running moved from function to
macro 'luaC_condGC'.
2012-05-11 16:22:33 -03:00
Roberto Ierusalimschy
0010ec68b1 documentation comment (small correction about strings being
gray)
2012-01-23 18:29:12 -02:00
Roberto Ierusalimschy
788a0ecd27 'luaC_separateudata' renamed to 'separatetobefnz' and called only
from 'lgc.c'
2011-10-03 14:54:25 -03:00
Roberto Ierusalimschy
f3b0eb3ecf lint (unused macros) 2011-09-30 09:44:19 -03:00
Roberto Ierusalimschy
c4ea0c3b29 detail (cleaning trailing spaces) 2011-01-26 14:30:02 -02:00
Roberto Ierusalimschy
868ff40339 full collection does not restart collector + avoid changing GC
state if an error happens in a step
2010-12-29 16:00:23 -02:00
Roberto Ierusalimschy
737f119187 better control for GC running or stopped 2010-12-20 16:17:46 -02:00
Roberto Ierusalimschy
a40768e5ea new macro 'luaC_condGC' to allow extra code to be run in case
of GC steps
2010-12-17 10:02:29 -02:00
Roberto Ierusalimschy
35931bbed4 comments 2010-12-02 17:51:15 -02:00
Roberto Ierusalimschy
9b7a12c46d finalizers (__gc) for tables 2010-11-26 12:32:31 -02:00
Roberto Ierusalimschy
a71c5f6f53 typo in comments 2010-06-30 11:11:17 -03:00
Roberto Ierusalimschy
fabe4ec487 better barrier for prototypes 2010-06-07 13:55:34 -03:00
Roberto Ierusalimschy
575074fd85 Lua closures are cached for reuse 2010-06-04 10:25:10 -03:00
Roberto Ierusalimschy
1c1a98e872 corrected some places where an old object could end up in front
of a new one + minimal documentation about this problem
2010-05-10 15:23:45 -03:00
Roberto Ierusalimschy
c006f085d9 new macro 'resetoldbit' 2010-05-10 13:46:49 -03:00
Roberto Ierusalimschy
32c1764b5d slightly better definition for 'isgray' 2010-05-07 15:43:51 -03:00
Roberto Ierusalimschy
b373a40133 new macro 'isgenerational' + new macro 'isold' + better deffinition
for 'isdead', compatible with the code used by 'sweeplist'
2010-05-07 15:08:05 -03:00
Roberto Ierusalimschy
a4f20e3c8b comments 2010-05-06 15:17:22 -03:00
Roberto Ierusalimschy
d77898597e new function 'luaC_changemode' 2010-05-05 15:53:41 -03:00
Roberto Ierusalimschy
0c27de2e7b no more 'finalize' phase in GC; finalizers are called along the
entire cycle
2010-05-03 14:33:39 -03:00
Roberto Ierusalimschy
85555646e3 invariant must be kept in atomic 'phase' too 2010-05-03 08:24:30 -03:00
Roberto Ierusalimschy
b9e1dec2cb added comment explaining a bit about the invariants of the collector 2010-04-30 15:36:45 -03:00
Roberto Ierusalimschy
23001d8607 nasty GC bug: upvalue must be turned white when not keeping invariant,
but barrier was not being called when uv->v were already white.
2010-04-29 18:43:36 -03:00
Roberto Ierusalimschy
aaa5d7adab 'luaC_linkupval' moved into 'lfunc.c' code + new way to control GC speed 2010-04-29 14:32:40 -03:00
Roberto Ierusalimschy
3aa9598177 'mainthread' is not inserted in the 'allgc' list anymore, but swept
separately.
2010-03-25 10:06:36 -03:00
Roberto Ierusalimschy
64d39ed1b6 generational mode no longer sweep old objects 2010-03-24 12:51:10 -03:00
Roberto Ierusalimschy
4433dbb5f5 userdata with finalizers are kept in a separated list ('udgc'), instead
of at the end of 'rootgc' (which was renamed to 'allgc', as it is not
"root" in the usual meaning for collectors)
2010-03-24 10:07:01 -03:00
Roberto Ierusalimschy
0bbdddc86b allocator function receives the tag of object being allocated in 'osize'
when 'ptr' is NULL.
2009-12-17 13:46:44 -02:00
Roberto Ierusalimschy
8da245bfd2 better to keep GC state numbers sequential, to optimize switch in
'singlestep'
2009-12-11 19:31:14 -02:00
Roberto Ierusalimschy
a2a2abcba4 new function 'luaC_runtilstate' to advance GC until a "valid" state 2009-12-11 17:14:59 -02:00
Roberto Ierusalimschy
3c4d970a7b comment typos 2009-11-26 09:39:20 -02:00
Roberto Ierusalimschy
ce444bff33 (huge) simplification of GC management 2009-11-18 11:13:47 -02:00
Roberto Ierusalimschy
b51d76ce8d when doing hard memory tests, perform a full GC at every possible step 2009-11-17 09:56:03 -02:00
Roberto Ierusalimschy
4a67e48611 new macro 'condmovestack' instead of 'condhardstacktests' 2009-06-08 16:35:59 -03:00
Roberto Ierusalimschy
e091a254df new way to GC stacks: the entire stack must be correct all the times;
the 'dead' part of a stack (after the top) must have only nil's, so
that 'top' may go up without cleaning the stack.
2009-04-28 16:04:36 -03:00
Roberto Ierusalimschy
0c8f5fc2fd simplification in the handling of finalizers: no more 'tmudata' list +
no more GCSsweeptmu collector's state
2008-06-26 16:42:45 -03:00
Roberto Ierusalimschy
e2b366c760 userdata with finalizers are kept in a separated list 2008-02-19 15:55:09 -03:00
Roberto Ierusalimschy
0e961ad47a some changes toward ephemerons 2007-10-29 14:51:20 -02:00
Roberto Ierusalimschy
3ca9af51a4 emergency garbage collector (core forces a GC when allocation fails) 2006-07-11 12:53:29 -03:00
Roberto Ierusalimschy
98296f6b45 some bugs related to stack reallocation 2005-08-24 13:15:49 -03:00
Roberto Ierusalimschy
746a1d612b small bug (type error) 2005-06-07 15:53:45 -03:00
Roberto Ierusalimschy
8718fda9b2 added LUAI_FUNC to functions not in the API 2005-04-25 16:24:10 -03:00
Roberto Ierusalimschy
d55bb795fa details 2005-02-23 14:30:22 -03:00
Roberto Ierusalimschy
4df8800a01 cleaner way to free all objects 2005-02-10 11:25:02 -02:00
Roberto Ierusalimschy
621ef9f767 better control over GC collors of upvalues 2005-01-19 13:54:26 -02:00
Roberto Ierusalimschy
0e54d2be36 bug: barrier was wrong for generational phase 2004-09-15 17:38:15 -03:00
Roberto Ierusalimschy
0b06241483 better control for GC cycles 2004-08-30 10:44:44 -03:00
Roberto Ierusalimschy
32d4f304db first implementation of generational GC 2004-08-24 17:12:06 -03:00
Roberto Ierusalimschy
26ae992129 less conservative write barrier for tables 2004-08-10 16:17:23 -03:00
Roberto Ierusalimschy
a4e1230f95 better way to control open upvalues 2004-03-15 18:04:33 -03:00
Roberto Ierusalimschy
b876ec61c0 new (temporary?) API for garbage collector 2004-03-09 14:34:35 -03:00
Roberto Ierusalimschy
2aaf7394ad more and better tools (assertions & inspectors) to check incremental GC 2004-02-16 16:09:52 -03:00
Roberto Ierusalimschy
beb2aa5a46 atomic operations are not GC "states" 2003-12-12 16:29:34 -02:00
Roberto Ierusalimschy
47fc57a252 TObject' renamed to TValue' + other name changes and better assertions
for incremental garbage collection
2003-12-10 10:13:36 -02:00
Roberto Ierusalimschy
df429f163a First version of incremental GC 2003-12-09 14:56:11 -02:00
Roberto Ierusalimschy
9db1942bac sweep of strings also incremental 2003-12-04 15:22:42 -02:00
Roberto Ierusalimschy
c6eac44a94 two different white flags (to distinguish dead elements from new ones) 2003-12-03 18:03:07 -02:00
Roberto Ierusalimschy
1d10acb355 incremental GC phases 2003-12-01 14:33:30 -02:00
Roberto Ierusalimschy
57b6ed6815 initial implementation of white/gray/black coloring 2003-11-19 17:41:57 -02:00
Roberto Ierusalimschy
366e4af3c9 towards incremental GC 2003-11-18 12:55:11 -02:00
Roberto Ierusalimschy
ab7d9bfd0c cleaner code for manipulation of `marked' field 2003-11-17 17:50:05 -02:00
Roberto Ierusalimschy
a0a384a6b1 bug: userdata to be collected still counts into new GC threshold,
increasing memory consumption
2003-07-29 16:25:37 -03:00
Roberto Ierusalimschy
fa26d294ae new way to control `pc' of running functions 2003-07-16 17:49:02 -03:00
Roberto Ierusalimschy
69dd9461e5 bug: GC metamethod calls could mess C/Lua stack syncronization 2003-02-28 16:45:15 -03:00
Roberto Ierusalimschy
6f207b15fb resist errors in finalizers during lua_close 2003-02-10 15:32:50 -02:00
Roberto Ierusalimschy
e47baca75a warnings from Visual C++ 2002-11-25 10:38:47 -02:00
Roberto Ierusalimschy
fdafd4f4a8 new structure for collectable objects, sharing a common header 2002-08-30 16:09:21 -03:00
Roberto Ierusalimschy
ecc7769de2 names... 2002-08-16 17:00:28 -03:00
Roberto Ierusalimschy
e043b72a55 simpler way to collect userdata 2001-12-10 20:11:23 -02:00
Roberto Ierusalimschy
592a309177 tag system replaced by event tables 2001-12-05 18:15:18 -02:00
Roberto Ierusalimschy
777061e441 resurect userdata before calling its GC tag method 2001-06-21 13:41:34 -03:00