summaryrefslogtreecommitdiff
path: root/lapi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Undo change in the handling of 'L->top' (commit b80077b8f3)Roberto Ierusalimschy2019-08-291-2/+0
| | | | | | With MMBIN instructions, there are fewer opcodes that need to update 'L->top', so that change does not seem to pay for the increased complexity.
* Change in the handling of 'L->top' when calling metamethodsRoberto Ierusalimschy2019-07-261-0/+2
| | | | | | | Instead of updating 'L->top' in every place that may call a metamethod, the metamethod functions themselves (luaT_trybinTM and luaT_callorderTM) correct the top. (When calling metamethods from the C API, however, the callers must preserve 'L->top'.)
* Calls 'luaF_close' in 'lua_settop' only when neededRoberto Ierusalimschy2019-07-171-5/+7
| | | | | In 'lua_settop', avoid calling 'luaF_close' when increasing the stack or when the function has no to-be-closed variables.
* Avoid setting the stack top below upvalues to be closedRoberto Ierusalimschy2019-07-161-7/+8
| | | | | | When leaving a scope, the new stack top should be set only after closing any upvalue, to avoid manipulating values in an "invalid" part of the stack.
* Small optimizations in range checksRoberto Ierusalimschy2019-03-271-4/+6
| | | | | | | | Checks of the form '1 <= x && x <= M' were rewritten in the form '(unsigned)x - 1 < (unsigned)M', which is usually more efficient. (Other similar checks have similar translations.) Although some compilers do these optimizations, that does not happen for all compilers or all cases.
* Changes in the warning systemRoberto Ierusalimschy2019-03-141-2/+2
| | | | | | | | - The warning functions get an extra parameter that tells whether message is to be continued (instead of using end-of-lines as a signal). - The user data for the warning function is a regular value, instead of a writable slot inside the Lua state.
* DetailsRoberto Ierusalimschy2019-03-131-9/+22
| | | | | | | | | | Several small improvements (code style, warnings, comments, more tests), in particular: - 'lua_topointer' extended to handle strings - raises an error in 'string.format("%10q")' ('%q' with modifiers) - in the manual for 'string.format', the term "option" replaced by "conversion specifier" (the term used by the C standard)
* After a "bad collections", avoid switching back back to generationalRoberto Ierusalimschy2019-01-301-4/+2
| | | | | | | 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).
* No more LUA_ERRGCMM errorsRoberto Ierusalimschy2019-01-011-3/+1
| | | | | Errors in finalizers (__gc metamethods) are never propagated. Instead, they generate a warning.
* Added a warning system to LuaRoberto Ierusalimschy2018-12-281-0/+18
| | | | | The warning system is just a way for Lua to emit warnings, messages to the programmer that do not interfere with the running program.
* Changes in the control of C-stack overflowRoberto Ierusalimschy2018-12-271-2/+2
| | | | | | | | | | * unification of the 'nny' and 'nCcalls' counters; * external C functions ('lua_CFunction') count more "slots" in the C stack (to allow for their possible use of buffers) * added a new test script specific for C-stack overflows. (Most of those tests were already present, but concentrating them in a single script easies the task of checking whether 'LUAI_MAXCCALLS' is adequate in a system.)
* A to-be-closed variable must have a closable value (or be nil)Roberto Ierusalimschy2018-11-291-1/+1
| | | | | | | 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.)
* Auxiliary buffer cannot close box with 'lua_remove'Roberto Ierusalimschy2018-11-261-2/+2
| | | | | | | 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".)
* 'lua_toclose' gets the index to be closed as an argumentRoberto Ierusalimschy2018-11-121-3/+10
| | | | | | 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).
* New syntax for to-be-closed variablesRoberto Ierusalimschy2018-11-071-1/+1
| | | | | | | 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').
* To-be-closed variables in the C APIRoberto Ierusalimschy2018-10-251-2/+13
|
* Details (comments)Roberto Ierusalimschy2018-09-111-1/+5
|
* Removed extra information from RCS keyword stringsRoberto Ierusalimschy2018-08-231-1/+1
| | | | | Version numbers and dates (mostly wrong) from RCS keyword strings removed from all source files; only the file name are kept.
* no need to check whether libraries and host use the same kernel;Roberto Ierusalimschy2018-06-181-5/+4
| | | | Lua should work correctly with several copies of the kernel
* new field 'nilvalue' in struct 'global_State' to avoid the use ofRoberto Ierusalimschy2018-06-151-13/+10
| | | | addresses of static variables
* removed unused macros 'isstackindex'/'api_checkstackindex' +Roberto Ierusalimschy2018-06-151-10/+2
| | | | macro 'api_checkvalidindex' (used only once) expanded and removed
* no more 'luaO_nilobject' to avoid comparison of global variable addressesRoberto Ierusalimschy2018-06-011-3/+5
| | | | (now uses static variables)
* no more nil-in-tableRoberto Ierusalimschy2018-04-041-22/+1
|
* 'lua_setiuservalue' removes value from the stack even in case of errorRoberto Ierusalimschy2018-02-271-2/+2
|
* metamethods for 'removekey'/'keyin'Roberto Ierusalimschy2018-02-271-11/+8
|
* better names for macros for tags and types.Roberto Ierusalimschy2018-02-261-16/+16
| | | | | rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag; tnov -> ttype
* first (parcial) implementation of 'keyin'/'removekey'Roberto Ierusalimschy2018-02-251-33/+59
| | | | (still no metamethods, no raw verssions)
* first version of empty entries in tablesRoberto Ierusalimschy2018-02-231-12/+18
| | | | (so that, in the future, tables can contain regular nil entries)
* userdata can have multiple user valuesRoberto Ierusalimschy2018-02-201-9/+26
|
* more generic way to handle 'gclist'Roberto Ierusalimschy2018-02-191-4/+4
|
* 'collectgarbage' returns old mode when changing modeRoberto Ierusalimschy2018-02-051-1/+5
|
* warnings in VS (implicit casts from ptrdiff_t to int)Roberto Ierusalimschy2018-01-291-2/+2
|
* janitor work on castsRoberto Ierusalimschy2018-01-281-4/+4
|
* error handler in protected calls must be a functionRoberto Ierusalimschy2018-01-101-1/+2
|
* more freedom in handling memory-allocation errors (not all allocationsRoberto Ierusalimschy2017-12-081-12/+2
| | | | | automatically raise an error), which allows fixing a bug when resizing a table.
* bug: 'lua_pushcclosure' should not call the GC when 'n' is zeroRoberto Ierusalimschy2017-12-061-3/+4
|
* detail (typo in comments)Roberto Ierusalimschy2017-11-231-2/+2
|
* back to 'CallInfo' (no gains with its removal)Roberto Ierusalimschy2017-11-071-42/+39
|
* no more useful fields in CallInfoRoberto Ierusalimschy2017-11-031-9/+9
|
* more fields moved out of 'CallInfo'Roberto Ierusalimschy2017-11-031-20/+25
|
* new API for 'lua_resume' + cleaning the uses of the 'extra' field inRoberto Ierusalimschy2017-11-021-4/+3
| | | | 'CallInfo'
* using 'L->func' when possibleRoberto Ierusalimschy2017-11-011-13/+12
|
* some cleaning in GC parametersRoberto Ierusalimschy2017-10-111-10/+15
|
* new type 'StackValue' for stack elementsRoberto Ierusalimschy2017-06-291-126/+142
| | | | (we may want to put extra info there in the future)
* macro 'luaV_fastget' may need protection ({}) to be used insideRoberto Ierusalimschy2017-06-011-3/+5
| | | | 'if's
* revamping the incremental collectorRoberto Ierusalimschy2017-05-261-20/+24
| | | | | | 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
* 'lua_rawlen' returns 'lua_Unsigned' instead of 'size_t'. (RealRoberto Ierusalimschy2017-05-181-2/+2
| | | | | length of strings and userdata are limited by Lua integers, but table length is hard to compute limiting it to 'size_t'.)
* revamp of fast track for table access (table set uses the sameRoberto Ierusalimschy2017-05-111-15/+26
| | | | macros as table get + new macro for integer keys)
* 'KGC_NORMAL' -> 'KGC_INC' + emergency GC signalled by flag (insteadRoberto Ierusalimschy2017-04-241-2/+2
| | | | of mode)
* macros to define default parameters for generational collectionRoberto Ierusalimschy2017-04-201-3/+8
|