Roberto Ierusalimschy
6d04537ea6
A to-be-closed variable must have a closable value (or be nil)
...
It is an error for a to-be-closed variable to have a non-closable
non-nil value when it is being closed. This situation does not seem to
be useful and often hints to an error. (Particularly in the C API, it is
easy to change a to-be-closed index by mistake.)
2018-11-29 16:02:44 -02:00
Roberto Ierusalimschy
7696c6474f
Auxiliary buffer cannot close box with 'lua_remove'
...
To remove a to-be-closed variable from the stack in the C API a
function must use 'lua_settop' or 'lua_pop'. Previous implementation of
'luaL_pushresult' was not closing the box. (This commit also added
tests to check that box is being closed "as soon as possible".)
2018-11-26 14:16:17 -02:00
Roberto Ierusalimschy
5fda30b4f9
'lua_toclose' gets the index to be closed as an argument
...
Sometimes it is useful to mark to-be-closed an index that is not
at the top of the stack (e.g., if the value to be closed came from
a function call returning multiple values).
2018-11-12 14:15:50 -02:00
Roberto Ierusalimschy
b8fed93215
New syntax for to-be-closed variables
...
The new syntax is <local *toclose x = f()>. The mark '*' allows other
attributes to be added later without the need of new keywords; it
also allows better error messages. The API function was also renamed
('lua_tobeclosed' -> 'lua_toclose').
2018-11-07 10:03:05 -02:00
Roberto Ierusalimschy
34840301b5
To-be-closed variables in the C API
2018-10-25 15:30:15 -03:00
Roberto Ierusalimschy
9cbf17b0f1
Details (comments)
2018-09-11 08:39:12 -03:00
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.
2018-08-23 14:26:12 -03:00
Roberto Ierusalimschy
af70905246
no need to check whether libraries and host use the same kernel;
...
Lua should work correctly with several copies of the kernel
2018-06-18 09:08:10 -03:00
Roberto Ierusalimschy
b95e466218
new field 'nilvalue' in struct 'global_State' to avoid the use of
...
addresses of static variables
2018-06-15 16:31:22 -03:00
Roberto Ierusalimschy
d406d3d05f
removed unused macros 'isstackindex'/'api_checkstackindex' +
...
macro 'api_checkvalidindex' (used only once) expanded and removed
2018-06-15 14:30:52 -03:00
Roberto Ierusalimschy
505fc91222
no more 'luaO_nilobject' to avoid comparison of global variable addresses
...
(now uses static variables)
2018-06-01 14:40:38 -03:00
Roberto Ierusalimschy
03c6a05ec8
no more nil-in-table
2018-04-04 11:23:41 -03:00
Roberto Ierusalimschy
fbea553ca2
'lua_setiuservalue' removes value from the stack even in case of error
2018-02-27 17:01:55 -03:00
Roberto Ierusalimschy
b7edf5d2d8
metamethods for 'removekey'/'keyin'
2018-02-27 14:48:28 -03:00
Roberto Ierusalimschy
ef8263f81f
better names for macros for tags and types.
...
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag;
tnov -> ttype
2018-02-26 11:16:05 -03:00
Roberto Ierusalimschy
d766e2ae17
first (parcial) implementation of 'keyin'/'removekey'
...
(still no metamethods, no raw verssions)
2018-02-25 09:48:16 -03:00
Roberto Ierusalimschy
9243c414d9
first version of empty entries in tables
...
(so that, in the future, tables can contain regular nil entries)
2018-02-23 10:16:18 -03:00
Roberto Ierusalimschy
ca6fe7449a
userdata can have multiple user values
2018-02-20 13:52:50 -03:00
Roberto Ierusalimschy
1afd5a152d
more generic way to handle 'gclist'
2018-02-19 17:06:56 -03:00
Roberto Ierusalimschy
56e50e8bc5
'collectgarbage' returns old mode when changing mode
2018-02-05 15:10:52 -02:00
Roberto Ierusalimschy
dc0ab1e8ca
warnings in VS (implicit casts from ptrdiff_t to int)
2018-01-29 14:21:35 -02:00
Roberto Ierusalimschy
e2b15aa21d
janitor work on casts
2018-01-28 13:13:26 -02:00
Roberto Ierusalimschy
728ff94595
error handler in protected calls must be a function
2018-01-10 10:02:35 -02:00
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.
2017-12-08 15:28:25 -02:00
Roberto Ierusalimschy
ae11e37e53
bug: 'lua_pushcclosure' should not call the GC when 'n' is zero
2017-12-06 16:08:03 -02:00
Roberto Ierusalimschy
599f1742c6
detail (typo in comments)
2017-11-23 17:29:04 -02:00
Roberto Ierusalimschy
ad0704e40c
back to 'CallInfo' (no gains with its removal)
2017-11-07 11:25:26 -02:00
Roberto Ierusalimschy
472c560705
no more useful fields in CallInfo
2017-11-03 15:22:54 -02:00
Roberto Ierusalimschy
54eb35a8aa
more fields moved out of 'CallInfo'
2017-11-03 10:12:30 -02:00
Roberto Ierusalimschy
ba36180fd7
new API for 'lua_resume' + cleaning the uses of the 'extra' field in
...
'CallInfo'
2017-11-02 09:28:56 -02:00
Roberto Ierusalimschy
b9e76be8a6
using 'L->func' when possible
2017-11-01 16:20:48 -02:00
Roberto Ierusalimschy
1d8920dd7f
some cleaning in GC parameters
2017-10-11 09:38:45 -03:00
Roberto Ierusalimschy
f96497397a
new type 'StackValue' for stack elements
...
(we may want to put extra info there in the future)
2017-06-29 12:06:44 -03:00
Roberto Ierusalimschy
b029e7ea20
macro 'luaV_fastget' may need protection ({}) to be used inside
...
'if's
2017-06-01 17:22:33 -03:00
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
2017-05-26 16:14:29 -03:00
Roberto Ierusalimschy
49f7aab62a
'lua_rawlen' returns 'lua_Unsigned' instead of 'size_t'. (Real
...
length of strings and userdata are limited by Lua integers,
but table length is hard to compute limiting it to 'size_t'.)
2017-05-18 09:34:58 -03:00
Roberto Ierusalimschy
7647d5d13d
revamp of fast track for table access (table set uses the same
...
macros as table get + new macro for integer keys)
2017-05-11 15:57:46 -03:00
Roberto Ierusalimschy
69371c4b84
'KGC_NORMAL' -> 'KGC_INC' + emergency GC signalled by flag (instead
...
of mode)
2017-04-24 13:59:26 -03:00
Roberto Ierusalimschy
f748b4bb40
macros to define default parameters for generational collection
2017-04-20 15:22:44 -03:00
Roberto Ierusalimschy
c7bdc0e0e8
first version of control for the generational collector
2017-04-19 14:02:50 -03:00
Roberto Ierusalimschy
a3d36fe283
Upvalues collected like everything else (with mark-sweep) instead
...
of reference count (simpler and better for generational mode)
2017-04-11 15:41:09 -03:00
Roberto Ierusalimschy
2331e1beec
small changes in 'luaC_upvalbarrier'
2017-04-06 10:08:56 -03:00
Roberto Ierusalimschy
f5f3df3bd1
generational collection: new attempt (still incomplete)
2017-02-23 18:07:34 -03:00
Roberto Ierusalimschy
03ca6385dc
call 'checkGC' *after* creating new objects (this is how 'execute'
...
does it)
(It increases the changes that 'allgc' start with a non-white
object, which helps 'entersweep')
2016-02-29 11:27:14 -03:00
Roberto Ierusalimschy
1a44e82200
'luaV_fastget' only treats the real fast case (table with a non-nil
...
value at given key, so that it does not need to check metamethods)
2016-01-05 14:07:21 -02:00
Roberto Ierusalimschy
ff1289a361
in 'luaD_call', use two functions instead of one with fixed boolean
...
argument
2015-11-02 16:48:07 -02:00
Roberto Ierusalimschy
8949904783
allow NULL string when length is zero in 'lua_pushlstring' and
...
'luaL_addlstring'
2015-10-06 13:10:22 -03:00
Roberto Ierusalimschy
364cdbdbdb
'setobj2t' incorporated into 'luaV_fastset' + 'invalidateTMcache'
...
is not needed in the fast track (as it does not create new
entries) + small bug in 'auxsetstr' (calling barrier with wrong
object) + using 'setobj2t' without side effects in its arguments
2015-09-09 10:45:50 -03:00
Roberto Ierusalimschy
502214f8a5
added assert for NULL pointer in 'lua_pushlstring'
2015-08-25 15:50:37 -03:00
Roberto Ierusalimschy
8f25d08637
'invalidateTMcache' not needed in all 'settable' uses
2015-08-03 17:40:26 -03:00