Roberto Ierusalimschy
b14609032c
Avoid the creation of too many strings in 'package'
Both when setting a path and searching for a file ('searchpath'),
this commit reduces the number of intermediate strings created
in Lua.
(For setting a path the change is not relevant, because this is
done only twice when loading the module. Anyway, it is a nice example
of how to use auxlib buffers to manipulate strings in the C API.)
6 years ago
Roberto Ierusalimschy
2c32bff609
After a "bad collections", avoid switching back back to generational
After a major bad collection (one that collects too few objects),
next collection will be major again. In that case, avoid switching
back to generational mode (as it will have to switch again to
incremental to do next major collection).
6 years ago
Roberto Ierusalimschy
e8c779736f
Removed internal cache for closures
The mechanism of "caching the last closure created for a prototype to
try to reuse it the next time a closure for that prototype is created"
was removed. There are several reasons:
- It is hard to find a natural example where this cache has a measurable
impact on performance.
- Programmers already perceive closure creation as something slow,
so they tend to avoid it inside hot paths. (Any case where the cache
could reuse a closure can be rewritten predefining the closure in some
variable and using that variable.)
- The implementation was somewhat complex, due to a bad interaction
with the generational collector. (Typically, new closures are new,
while prototypes are old. So, the cache breaks the invariant that
old objects should not point to new ones.)
6 years ago
Roberto Ierusalimschy
f99509581e
Removed extra information from RCS keyword strings
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
6 years ago
Roberto Ierusalimschy
992b6d2712
no more 'TESTGRAYBIT' (to free this bit for real uses)
7 years ago
Roberto Ierusalimschy
1afd5a152d
more generic way to handle 'gclist'
7 years ago
Roberto Ierusalimschy
a131eae925
default for minor collection intervals a little larger
7 years ago
Roberto Ierusalimschy
e2b15aa21d
janitor work on casts
7 years ago
Roberto Ierusalimschy
1d8920dd7f
some cleaning in GC parameters
7 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
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
c0836dda74
avoid empty macro arguments (invalid in C89)
9 years ago
Roberto Ierusalimschy
3ad55386c4
'condchangemem' also may need to run 'pre'/'pos'
9 years ago
Roberto Ierusalimschy
caf8278710
added comments
9 years ago
Roberto Ierusalimschy
f7670781cf
cleaner definition for 'luaC_condGC', using 'pre'/'pos' parameters
9 years ago
Roberto Ierusalimschy
20b9e59441
barrier macros rewritten as expressions
9 years ago
Roberto Ierusalimschy
bdf566a8a3
`name' in comments changed to 'name'
10 years ago
Roberto Ierusalimschy
3c6d0aaa7d
'iswhite' and related macros now can work directly on any object
(no need to convert to 'GCObject')
10 years ago
Roberto Ierusalimschy
e43612aaf6
put the restriction that 'luaC_barrierback' works only on tables
in its prototype
10 years ago
Roberto Ierusalimschy
9aec500a26
no need for field 'gch' anymore
10 years ago
Roberto Ierusalimschy
ed795d5ff4
detail (removed unused prototype)
11 years ago
Roberto Ierusalimschy
3f78de256e
no need to keep threads in a different GC list, now that there is the
'twups' list
11 years ago
Roberto Ierusalimschy
1cce3e6842
change in the way 'collectgarbage("step", size)' interprets 'size'
(mimicking the way the GC itself behaves when Lua allocates 'size'
Kbytes)
11 years ago
Roberto Ierusalimschy
de3b1c9b53
better control for number of finalizers called at each GC cycle
(increases progressively)
11 years ago
Roberto Ierusalimschy
733c58595b
no more local collection
11 years ago
Roberto Ierusalimschy
ba3586cc90
keep a single list of objects to be finalized (with local and non-local
objects), to ensure finalization order
11 years ago
Roberto Ierusalimschy
06156e7575
detail (setmetatable do not need to use a back GC barrier)
11 years ago
Roberto Ierusalimschy
4eeb1831be
new names and better order for GC states (sweep first lists that
can have dead objects)
11 years ago
Roberto Ierusalimschy
dd373a8f66
threads are kept in a separated GC list, linked after the main thread
11 years ago
Roberto Ierusalimschy
d8aa8dd97e
objects in list 'tobefnz' have a GC life-cycle like all others
(specifically they are cleaned during sweep phase)
11 years ago
Roberto Ierusalimschy
1150873447
'luaC_newobj' does not handle special cases; only special case
now is threads, which do not use 'luaC_newobj' anymore.
11 years ago
Roberto Ierusalimschy
aeff4f79fa
local collection now calls finalizers
11 years ago
Roberto Ierusalimschy
1bf4faec64
new GC state to sweep 'localgc' list + small changes in sweep control
11 years ago
Roberto Ierusalimschy
26629d0af1
details (a few casts moved from macro invocation to macro definition)
11 years ago
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
11 years ago
Roberto Ierusalimschy
af35c7f398
upvalues collected by reference count
11 years ago
Roberto Ierusalimschy
50955e27f5
C functions and strings now go to the local list; first version
of the local collector
11 years ago
Roberto Ierusalimschy
0df6635711
"fixed" objects kept in a separated list (instead of being kept in
'allgc' list with a bit marking them)
11 years ago
Roberto Ierusalimschy
ae800656c9
change in string table: string table is now independent of GC lists; all
strings live in 'normal' GC lists
11 years ago
Roberto Ierusalimschy
8f6b80aa1d
GC bits SEPARATED and FINALIZEDBIT mixed in FINALIZEDBIT (with simpler
control)
11 years ago
Roberto Ierusalimschy
9eff921f8f
"barrier" for link prototype->cache changed to be consistent with
GC behavior (link is cleared to preserve invariant)
11 years ago
Roberto Ierusalimschy
439d74e29f
added 'local' bit (true => object is only refered by local variables)
11 years ago
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')
11 years ago
Roberto Ierusalimschy
677d90165f
no more generational collection !!!
11 years ago
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.
12 years ago