Roberto Ierusalimschy
575074fd85
Lua closures are cached for reuse
2010-06-04 10:25:10 -03:00
Roberto Ierusalimschy
e94fac8956
bug: generational collection was not running collector! (must write
...
a test for this...)
2010-06-02 15:36:58 -03:00
Roberto Ierusalimschy
3d45a8eb1c
really stop collection during finalizers
2010-05-17 17:39:31 -03:00
Roberto Ierusalimschy
4fd76b8148
avoid "strong" cast
2010-05-11 17:49:26 -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
de97177744
avoid 'else assert' (which may result in an empty else)
2010-05-07 15:43:24 -03:00
Roberto Ierusalimschy
0fac33da9e
bug: incremental sweep was not cleaning old bits (as it stopped in the
...
first old object) + bug: moving udata to 'udgc' list might put old
object in front a new one + some new macros + generational mode may
be in 'pause' state (it just skips 'markroot')
2010-05-07 15:19:36 -03:00
Roberto Ierusalimschy
25951e0ea5
some cleaning in 'sweeplist' (threads do not need to be traversed
...
if they are going to be collected + use of bit masks to unify
differences in generational and incremental modes)
2010-05-06 15:18:07 -03:00
Roberto Ierusalimschy
d2ea5b00b7
new function 'luaC_changemode' +
...
bug: objects entering the 'allgc' list must have their OLDBIT cleared
(upvalues being cleared) + bug: in 'checkSizes', KGC_EMERGENCY is
stored in 'gckind' field, not in 'gcstate' + current white changes when
entering sweep phase (so there are dead objects only in that phase)
2010-05-05 15:58:36 -03:00
Roberto Ierusalimschy
7444b5a1d5
better documentation of GC costs
2010-05-05 10:39:58 -03:00
Roberto Ierusalimschy
3e662cec89
full GC must run finalizers only after finishing everything else
...
(including a return to generational mode if needed)
2010-05-04 15:09:06 -03:00
Roberto Ierusalimschy
aa73403ba4
no need of a KGC_FORCED collection kind; it has the same behavior of
...
a normal collection
2010-05-03 14:39:48 -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
d25f7f9d78
items in 'tobefnz' are kept black (as before recent change) and changed
...
to white only when needed (being moved to 'allgc' when not keeping
invariant).
2010-05-03 08:55:40 -03:00
Roberto Ierusalimschy
4d871ee973
"gray lists" only need to be valid when 'keepinvariant' is true
2010-04-30 15:37:14 -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
00114a95b2
lots of new comments + small changes in loop controls + other small
...
"janitor work"
2010-04-26 14:58:00 -03:00
Roberto Ierusalimschy
4aaf0ef75c
"to-be-finalized" objects marked and sweeped like all other objects
2010-04-20 17:15:30 -03:00
Roberto Ierusalimschy
d20ff60615
new macro LUA_NUMTAGS
2010-04-12 13:07:29 -03:00
Roberto Ierusalimschy
a09c8d7beb
cannot sweep main thread in sweepstring phase
2010-04-05 11:15:35 -03:00
Roberto Ierusalimschy
e54668b696
added proper code to trace garbage collection
2010-04-02 11:37:41 -03:00
Roberto Ierusalimschy
a8d3aa14fd
global table now is only kept in the registry
2010-03-29 14:43:14 -03:00
Roberto Ierusalimschy
064e406f67
no more fenvs!
2010-03-26 17:58:11 -03:00
Roberto Ierusalimschy
5c87f61e6b
major collections in generational mode
2010-03-25 16:37:23 -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
5cb128ea54
BUG: emergency collector might resize 'strt' (string table) when
...
creating a new string
+ atomic and markroot steps has some cost
+ full collection must leave collector in proper state when mode
is generational
2010-03-23 17:16:06 -03:00
Roberto Ierusalimschy
74123e9686
draft version of a generational mode for garbage collection. (Not well
...
tested; no major collections; ...)
2010-03-22 15:28:03 -03:00
Roberto Ierusalimschy
f84b575cfa
no more pseudoindex LUA_GLOBALSINDEX; global table now accessible
...
through registry
2009-12-22 13:32:50 -02: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
88eb901f81
registry and global table may be changed through the API without a
...
write barrier, so GC should visit them in the atomic phase.
2009-11-09 16:29:21 -02:00
Roberto Ierusalimschy
a921d81033
avoid using 'ttype' when there is an explicit test + macro 'checkdeadkey'
...
to avoid repetitions
2009-11-06 15:06:19 -02:00
Roberto Ierusalimschy
9756f56354
better control over accesses to TValue fields
2009-11-05 15:43:54 -02:00
Roberto Ierusalimschy
5bc91c6405
no more one environment per thread: all threads share a single global
...
environment
2009-10-23 17:12:19 -02:00
Roberto Ierusalimschy
5938212748
information about upvalues (where they come from) kept in Proto structure,
...
instead of sequence of pseudo-opcodes after OP_CLOSURE
2009-09-28 13:32:50 -03:00
Roberto Ierusalimschy
1829911d7c
some operations may shrink g->totalbytes so g->estimate must be
...
more flexible
2009-09-28 10:50:34 -03:00
Roberto Ierusalimschy
55dc7fb240
bug: stack must be cleared until its end (including extra size) +
...
control of stack size moved to 'ldo.c'
2009-07-16 13:26:09 -03:00
Roberto Ierusalimschy
4a67e48611
new macro 'condmovestack' instead of 'condhardstacktests'
2009-06-08 16:35:59 -03:00
Roberto Ierusalimschy
019ebcb85f
errors in finalizers are propagated with code LUA_ERRGCMM (ERRor in
...
__gc MetaMethod)
2009-05-21 17:06:11 -03:00
Roberto Ierusalimschy
673c456cba
resize string hash table only when new size is smaller than current one
2009-04-29 14:09:41 -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
4f88418170
'CallInfo' stack implemented as double-linked list instead of an array
2009-04-17 11:28:06 -03:00
Roberto Ierusalimschy
ba484b9eb1
yielding across lua_call (first version)
2009-03-10 14:14:37 -03:00