Roberto Ierusalimschy
ccae0f5aad
Comments about OLD0/OLD1 ages
Improved the comments in file 'lgc.c' explaining the roles of "ages"
OLD0 and OLD1 in the generacional collector.
6 years ago
Roberto Ierusalimschy
2e297d6ab3
Fixed bug in generational collection of userdata
During generational collection, a userdatum must become gray and
go to a gray list after being traversed (like tables), so that
'correctgraylist' can handle it to its next stage.
This commit also added minimum tests for the generational collector,
including one that would detect this bug.
6 years ago
Roberto Ierusalimschy
626cf0581b
Generational mode may wait longer after a major collection
When Lua is building large long-duration structures, frequent small
minor collections just waste time. Trying to avoid this, the
collector will do a larger pause after a major collection when it
does not collect enough garbage (which is a hint that memory is
being used for long-lasting objects).
6 years ago
Roberto Ierusalimschy
6e600695f8
field 'sizearray' in struct 'Table' changed to 'alimit', which can
be used as a hint for '#t'
6 years ago
Roberto Ierusalimschy
0c7738240e
FALLTHROUGH comment must be last "statement"
(so it does not work when inside a block)
7 years ago
Roberto Ierusalimschy
2952bc5fc9
special compact representation for userdata with no user values
(a common case)
7 years ago
Roberto Ierusalimschy
4a7fe61806
in 'clearbykeys', clear keys of just-removed entries too
7 years ago
Roberto Ierusalimschy
9243c414d9
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
7 years ago
Roberto Ierusalimschy
477ca2fe8c
some reorganization in 'lobject.h'
(just moving stuff around)
7 years ago
Roberto Ierusalimschy
ca6fe7449a
userdata can have multiple user values
7 years ago
Roberto Ierusalimschy
1afd5a152d
more generic way to handle 'gclist'
7 years ago
Roberto Ierusalimschy
daff7c3b4d
small corrections in generational mode
(cannot call finalizers in emergency collections +
should set everything before calling finalizers)
7 years ago
Roberto Ierusalimschy
e2b15aa21d
janitor work on casts
7 years ago
Roberto Ierusalimschy
cf7eff45f3
keep control of stack top in Lua functions concentrated in 'luaV_execute'
7 years ago
Roberto Ierusalimschy
1d5b885437
when running Lua code, there is no need to keep 'L->top' "correct";
set it only when needed.
7 years ago
Roberto Ierusalimschy
e663a24ab0
more freedom in handling memory-allocation errors (not all allocations
automatically raise an error), which allows fixing a bug when resizing
a table.
7 years ago
Roberto Ierusalimschy
421e459684
'luaS_resize' can raise memory errors
7 years ago
Roberto Ierusalimschy
ac78b914b6
warnings from Visual Studio /W3
7 years ago
Roberto Ierusalimschy
599f1742c6
detail (typo in comments)
7 years ago
Roberto Ierusalimschy
ad0704e40c
back to 'CallInfo' (no gains with its removal)
7 years ago
Roberto Ierusalimschy
54eb35a8aa
more fields moved out of 'CallInfo'
7 years ago
Roberto Ierusalimschy
de9128d09d
do not mess up the debt when the collector is not running
7 years ago
Roberto Ierusalimschy
1d8920dd7f
some cleaning in GC parameters
7 years ago
Roberto Ierusalimschy
029d269f4d
bug: dead keys with nil values can stay in weak tables
7 years ago
Roberto Ierusalimschy
f96497397a
new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
7 years ago
Roberto Ierusalimschy
73ec04fcf3
no more 'DEADKEY'. Table traversals do not need to consider dead keys;
if the key is dead, it cannot be given to 'next'. Instead, we now
use a 'table' tag without the collectable bit, which makes it
a unique tag good enough to reserve space.
8 years ago
Roberto Ierusalimschy
b6f87491af
in hash nodes, keys are stored in separate pieces to avoid wasting
space with alignments
8 years ago
Roberto Ierusalimschy
4bc33d64de
avoid overflows in computation of step size
8 years ago
Roberto Ierusalimschy
72d82a296c
revamping the incremental collector
Some simplifications (not counting bytes, couting only slots visited;
no more 'gcfinnum'); more GC parameters; using vararg in 'lua_gc' to
set parameters in different GC modes
8 years ago
Roberto Ierusalimschy
2376eb6347
barrier for prototype's cache (with new gray list 'protogray' to keep
prototypes to have their caches visited again) + constant 'MAXMISS'
8 years ago
Roberto Ierusalimschy
8634b2a011
added 'cachemiss' field to prototype to avoid wasting time checking
hits that fail too often
8 years ago
Roberto Ierusalimschy
f399e6705f
ensures that "collectgarbage'step'" in generational mode does a
minor collection
8 years ago
Roberto Ierusalimschy
69371c4b84
'KGC_NORMAL' -> 'KGC_INC' + emergency GC signalled by flag (instead
of mode)
8 years ago
Roberto Ierusalimschy
c354211744
small bug in generational control
8 years ago
Roberto Ierusalimschy
c7bdc0e0e8
first version of control for the generational collector
8 years ago
Roberto Ierusalimschy
16001acb15
small corrections + removal of debugging functions 'count' and
'printgray'.
8 years ago
Roberto Ierusalimschy
0c8a7e071b
'mainthread' lives in 'allgc' list, like everybody else
8 years ago
Roberto Ierusalimschy
a3d36fe283
Upvalues collected like everything else (with mark-sweep) instead
of reference count (simpler and better for generational mode)
8 years ago
Roberto Ierusalimschy
9569ad6b0d
Comments for generational collector
8 years ago
Roberto Ierusalimschy
2331e1beec
small changes in 'luaC_upvalbarrier'
8 years ago
Roberto Ierusalimschy
e4287da3a6
generational collector (still not complete)
8 years ago
Roberto Ierusalimschy
f5f3df3bd1
generational collection: new attempt (still incomplete)
8 years ago
Roberto Ierusalimschy
2a235312f0
detail (removing spaces at end of lines)
8 years ago
Roberto Ierusalimschy
7b1fba69b7
using 'lastfree == NULL' to signal that table is using the dummy
node for its hash part + new macro 'allocsizenode'
8 years ago
Roberto Ierusalimschy
138d00176c
new flag in 'CallInfo.callstatus' to tell whether function is running
as a finalizer
8 years ago
Roberto Ierusalimschy
8d4feb504f
do not try to ensure that 'sweepgc' points to a live object
when entering sweep phase ('entersweep'); that may be too
expensive to be done still inside the atomic step. Walking
one single object more often than not will work.
9 years ago
Roberto Ierusalimschy
03412af06e
detail (removed fixed argument to function 'callallpendingfinalizers')
9 years ago
Roberto Ierusalimschy
7485512384
added comment and assert about dead keys
9 years ago
Roberto Ierusalimschy
ff1289a361
in 'luaD_call', use two functions instead of one with fixed boolean
argument
9 years ago
Roberto Ierusalimschy
cd73f3ccc5
now that we have a counter for CallInfos, use it for a more
accurate value for the memory used by a thread
9 years ago