Commit Graph

591 Commits

Author SHA1 Message Date
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
Roberto Ierusalimschy 3b795541c4 fast track for 'settable' 2015-08-03 16:50:49 -03:00
Roberto Ierusalimschy e247c3ada3 implementation of fast track for gettable operations 2015-07-20 15:24:50 -03:00
Roberto Ierusalimschy dcad08b76d details (use original type when saving variable's value) 2015-06-18 11:19:52 -03:00
Roberto Ierusalimschy 67bf789462 avoid using API functions inside the core 2015-04-06 09:23:48 -03:00
Roberto Ierusalimschy e723c75c02 details (avoid 'lint' warnings) 2015-03-28 16:14:47 -03:00
Roberto Ierusalimschy a30c66f0fc macro 'luai_apicheck'/'api_check' back with a 'lua_State' parameter
(some people use it)
2015-03-06 16:49:50 -03:00
Roberto Ierusalimschy 2e6e53c7cc added API checks to some unprotected 'top' increments 2015-02-11 16:47:22 -02:00
Roberto Ierusalimschy 7e2015a46d size of short strings stored in a single byte, to reduce the size
of struct 'TString'
2015-01-16 14:54:37 -02:00
Roberto Ierusalimschy fb6796ba06 removed useless initializations 2014-12-26 12:43:45 -02:00
Roberto Ierusalimschy e5fd1e5fe2 details (match parameter names with lua.h and manual) 2014-11-12 11:28:54 -02:00
Roberto Ierusalimschy 28fdbcf393 added include for 'lprefix.h', for stuff that must be added before
any other header file
2014-11-02 17:19:04 -02:00
Roberto Ierusalimschy c25072a246 'lua_load' sets _ENV for any chunk with upvalues (not just those
with exactly one upvalue)
2014-10-31 15:41:51 -02:00
Roberto Ierusalimschy 9de384e27a removed useless 'include math.h' 2014-10-28 15:27:50 -02:00
Roberto Ierusalimschy bdf566a8a3 `name' in comments changed to 'name' 2014-10-25 09:50:46 -02:00
Roberto Ierusalimschy 0d31efb365 'lua_stringtonum' -> 'lua_stringtonumber' 2014-10-17 16:17:55 -03:00
Roberto Ierusalimschy 89602bf747 'lua_strtonum' -> 'lua_stringtonum' 2014-10-15 11:27:40 -03:00
Roberto Ierusalimschy 2a21f6c894 'lua_Kcontext' -> 'lua_KContext' 2014-10-07 15:29:13 -03:00
Roberto Ierusalimschy 9b25347a67 detail 2014-08-27 11:59:33 -03:00
Roberto Ierusalimschy 7f1a2ad699 new functions 'lua_geti/lua_seti' (non raw) 2014-08-21 17:07:56 -03:00
Roberto Ierusalimschy 2be88d5084 'lua_Ctx' -> 'lua_Kcontext' 2014-08-01 14:33:08 -03:00
Roberto Ierusalimschy 34ac039fb8 new macro 'cvt2str' to better control whether numbers are convertible
to strings
2014-07-30 11:00:14 -03:00
Roberto Ierusalimschy 97e299c395 'lua_replace' implemented as a macro using 'lua_copy' 2014-07-22 15:07:47 -03:00
Roberto Ierusalimschy c697aa30bc more precise type for argument to 'aux_upvalue' 2014-07-21 13:02:57 -03:00
Roberto Ierusalimschy e43612aaf6 put the restriction that 'luaC_barrierback' works only on tables
in its prototype
2014-07-19 12:09:37 -03:00
Roberto Ierusalimschy bb12903120 type 'Udata' refers directly to structure inside the union (union
used only for aligning purposes now)
2014-07-18 11:46:47 -03:00
Roberto Ierusalimschy 56137d58ff added check for conversion 'obj2gco' (and corrections for small
problems detected by this check)
2014-07-18 09:17:54 -03:00
Roberto Ierusalimschy 1aa4f69b51 new type 'lua_Ctx' for continuation-function contexts (to allow type
to be configurable)
2014-07-17 10:53:37 -03:00
Roberto Ierusalimschy 5bbb4a06a6 removed unused parameter Ä'L' in macro 'api_check' and company 2014-07-15 18:26:50 -03:00
Roberto Ierusalimschy d4fb848be7 added api check in 'lua_typename' (tag is valid) 2014-07-15 18:14:49 -03:00
Roberto Ierusalimschy b9dcf9974d detail (typos in comments) 2014-06-30 16:48:08 -03:00
Roberto Ierusalimschy 08a9c9faa3 detail (comment) 2014-06-26 15:28:24 -03:00
Roberto Ierusalimschy 84fe52dbeb unsigned-manipulation functions (lua_puhsunsigned, lua_tounsigned, etc.)
deprecated
2014-06-26 14:25:11 -03:00
Roberto Ierusalimschy 54ac5960a8 LUA_MAXUNSIGNED was only used to define 2.0^intnumbits (and that
definition was not strictly portable), so it was removed and
replaced by a more correct and direct definition for 2.0^intnumbits
(only where it was needed)
2014-06-24 14:02:00 -03:00
Roberto Ierusalimschy 89b56e7d84 more precision between closure types ('LClosure' x 'CClosure') 2014-06-19 15:27:20 -03:00
Roberto Ierusalimschy fa3113ffbf cleaner way to handle bit CIST_OAH (with auxiliar macros) 2014-06-12 16:07:30 -03:00
Roberto Ierusalimschy 8b5940e7ca must also reset CIST_OAH if necessary (CallInfo is not a fresh one) 2014-06-10 16:13:26 -03:00
Roberto Ierusalimschy 542b6cfc02 no need for field 'status' in structure 'CallInfo' (after removal
of 'lua_getctx') + field 'old_allowhook' can be packed into a single
bit
2014-06-10 15:51:21 -03:00
Roberto Ierusalimschy 6f6fd96e3b new type lua_KFunction + no more 'lua_getctx' 2014-06-10 14:41:38 -03:00
Roberto Ierusalimschy 8927c14317 removed macro 'luai_checknum' (as NaN trick is not doable now) 2014-05-15 17:28:39 -03:00
Roberto Ierusalimschy fd1672ba98 avoid non-conformant pointer arithmetic in api check for 'lua_rotate' 2014-05-15 12:22:45 -03:00
Roberto Ierusalimschy e3b9569e04 function 'reverse' uses appropriate variants of 'setobj' for better
documentation
2014-05-14 15:32:30 -03:00
Roberto Ierusalimschy 965993da07 comments added to 'lua_rotate' 2014-05-14 11:20:17 -03:00
Roberto Ierusalimschy 5a5a834975 new API function 'lua_rotate' 2014-05-13 16:40:28 -03:00
Roberto Ierusalimschy 4fe11ae232 'lua_getuservalue' returns type of user value 2014-05-01 15:21:32 -03:00
Roberto Ierusalimschy c549d4fe64 'lua_strtonum' (and 'luaO_str2num') now return string size, instead of
receiving it
2014-05-01 15:18:06 -03:00
Roberto Ierusalimschy 5388aa9fc0 'luaO_str2d' + 'luaO_str2int' replaced by 'luaO_str2num' (which converts
to float or integer according to the string syntax)
2014-04-30 13:48:44 -03:00
Roberto Ierusalimschy ffa43df3cd 'setnvalue' -> 'setfltvalue' (for consitency with 'fltvalue') 2014-04-29 15:14:16 -03:00
Roberto Ierusalimschy 037a70dfea cast_u2s/cast_s2u renamed l_castS2U/l_castU2S to be configurable from
outside (mostly for testing)
2014-04-15 13:32:49 -03:00
Roberto Ierusalimschy 8f961da3db macros cast_integer/cast_unsigned replaced by cast_u2s/cast_s2u, that
should be used only between lua_Integer and lua_Unsigned
2014-04-15 11:29:30 -03:00
Roberto Ierusalimschy ef789d4161 new global macro 'LUA_MAXUNSIGNED' 2014-04-12 11:45:10 -03:00
Roberto Ierusalimschy 493b3fdd65 added an 'api_check' for negative sizes in 'lua_checkstack' 2014-04-01 15:51:23 -03:00
Roberto Ierusalimschy a3addae036 lua_gettable and similars return type of gotten value 2014-03-12 17:57:40 -03:00
Roberto Ierusalimschy 87c930676f detail (comments) 2014-02-26 09:39:30 -03:00
Roberto Ierusalimschy 295f7ac04e added 'stip' parameter to lua_dump/string.dump 2014-02-25 11:30:21 -03:00
Roberto Ierusalimschy c86b9da022 userdata can have any Lua value as uservalue 2014-02-19 10:52:42 -03:00
Roberto Ierusalimschy ffa96d988d field 'op' renamed to 'open' 2014-02-15 11:12:01 -02: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 90b0ac6495 limit to 'gcstepmul' imposed by 'lua_gc' (+ some details in 'lgc.c') 2014-02-13 15:25:20 -02:00
Roberto Ierusalimschy 733c58595b no more local collection 2014-02-13 10:11:34 -02:00
Roberto Ierusalimschy 86dd8bf3f5 no more 'L' in macros "luai_num*" (several places that use those macros
cannot throw errors anyway...)
2014-01-27 11:34:32 -02:00
Roberto Ierusalimschy 1ea2d20f74 first implementation of '<<', '>>', and '~' (bitwise not) 2013-12-30 18:47:58 -02:00
Roberto Ierusalimschy cac1ebd1e0 detail ('ttisuserdata' renamed to 'ttisfulluserdata') 2013-12-04 10:15:22 -02:00