2af0d3b459
allocator function receives the tag of object being allocated in 'osize' when 'ptr' is NULL.
Roberto Ierusalimschy
2009-12-16 14:42:58 -02:00
9fbe0690fb
base-level C use global table as its environment
Roberto Ierusalimschy
2009-12-15 09:25:36 -02:00
1375435e4a
several new features in testC to allow better testing of lua_resume at the C API level
Roberto Ierusalimschy
2009-12-10 16:21:28 -02:00
2bb19ccf08
reordering of some functions + cleaner way to code lua_resume/resume + small bug in lua_resume (in case of calling errors lua_resume should remove only new arguments from the stack and push error message).
Roberto Ierusalimschy
2009-12-10 16:20:07 -02:00
64d5df7772
detail (lua_resume should empty coroutine stack even if they do not fit into caller stack)
Roberto Ierusalimschy
2009-12-10 16:17:37 -02:00
2643da67c6
error messages from 'lua_resume' must be generated in protected mode, to avoid raising memory errors
Roberto Ierusalimschy
2009-12-08 16:59:24 -02:00
ed117bb42a
lua_checkstack does not raise memory errors (instead it signals them)
Roberto Ierusalimschy
2009-12-08 14:15:43 -02:00
a4472490bc
new 'table.pack' function
Roberto Ierusalimschy
2009-12-07 13:50:27 -02:00
df1dc3f1f5
strings in C scripts may be delimited by quotes + new functionality to set C scripts as C hooks
Roberto Ierusalimschy
2009-12-01 14:49:48 -02:00
b0f2b288a6
new scheme for debug info about tail calls: no more 'fake' stack entries, but stack entry knows whether it was tail called
Roberto Ierusalimschy
2009-11-25 13:27:51 -02:00
2b25489b47
'notail' -> 'noextrachars' ('notail' may confuse with tail calls)
Roberto Ierusalimschy
2009-11-24 16:05:12 -02:00
a6f465f558
new mark LUAMOD_API for all luaopen_* functions
Roberto Ierusalimschy
2009-11-24 10:05:44 -02:00
9a41506b8f
'os.exit' should close state only when second argument is true
Roberto Ierusalimschy
2009-11-23 16:20:38 -02:00
9a6d9ea57a
GC may get stuck during a parser and avoids proper resizing of the string table, making its lists grow too much and degrading performance.
Roberto Ierusalimschy
2009-11-23 12:59:30 -02:00
062e809e54
new macros 'LUAI_DDEC'/'LUAI_DDEF' to better control declarations and definitions of non-static variables
Roberto Ierusalimschy
2009-11-19 17:06:52 -02:00
b4c1824824
'luaV_arith' must be marked 'LUAI_FUNC' (as all non-static functions)
Roberto Ierusalimschy
2009-11-19 17:04:58 -02:00
2e5ef6a9fb
new macro 'isdummy'
Roberto Ierusalimschy
2009-11-19 15:54:07 -02:00
1dea393058
small corrections for 'luaall.c'
Roberto Ierusalimschy
2009-11-19 14:26:52 -02:00
1ce819333d
new option 'isrunning' for 'lua_gc' (and 'collectgarbage')
Roberto Ierusalimschy
2009-11-09 16:55:17 -02:00
88eb901f81
registry and global table may be changed through the API without a write barrier, so GC should visit them in the atomic phase.
Roberto Ierusalimschy
2009-11-09 16:29:21 -02:00
2583bac3d3
several small changes to simplify changing TValue if needed
Roberto Ierusalimschy
2009-11-06 15:09:27 -02:00
63a3b1a1eb
macro 'checkvalref' redefined as function (to avoid too long macros)
Roberto Ierusalimschy
2009-11-06 15:08:43 -02:00
49a67c6d3f
new macro 'NILCONSTANT' to initialize nil constants
Roberto Ierusalimschy
2009-11-06 15:07:12 -02:00
a921d81033
avoid using 'ttype' when there is an explicit test + macro 'checkdeadkey' to avoid repetitions
Roberto Ierusalimschy
2009-11-06 15:06:19 -02:00
155dd01163
avoid using 'ttype' when there is an explicit test
Roberto Ierusalimschy
2009-11-06 15:05:34 -02:00
599789a907
better to enclose macros in 'if' bodies with brackets
Roberto Ierusalimschy
2009-11-06 15:03:37 -02:00
9756f56354
better control over accesses to TValue fields
Roberto Ierusalimschy
2009-11-05 15:43:54 -02:00
b7d5f18d71
api functions to manipulate upvalues do not need to check their arguments (the caller must check them before calling)
Roberto Ierusalimschy
2009-11-05 15:26:00 -02:00
5598b2bc55
new functions to identify and join upvalues
Roberto Ierusalimschy
2009-11-05 14:48:31 -02:00
77077b39d5
comment explaining OP_VARARG was wrong (and corresponding code was not very clear)
Roberto Ierusalimschy
2009-10-28 10:20:07 -02:00
5bc91c6405
no more one environment per thread: all threads share a single global environment
Roberto Ierusalimschy
2009-10-23 17:12:19 -02:00
f5073de0a7
'ipairs' goes until length of array instead of stopping at the first nil
Roberto Ierusalimschy
2009-10-23 10:50:25 -02:00
f6ed285cf2
new hash for doubles based on frexp, to avoid low-level tricks
Roberto Ierusalimschy
2009-10-23 10:31:12 -02:00
6e415e9387
local function definition does not need to correct debug information
Roberto Ierusalimschy
2009-10-13 16:35:42 -03:00
b114c99a60
two small bugs: 'debug.getinfo' did not consider negative indices as out of range + 'debug.[gs]etlocal' crash on tail calls
Roberto Ierusalimschy
2009-10-13 16:07:40 -03:00
916587508c
parser keeps list of active local variables in a single dynamic array, therefore saving C stack space
Roberto Ierusalimschy
2009-10-11 17:02:19 -03:00
a5382b763c
new function lua_copy
Roberto Ierusalimschy
2009-10-05 13:44:33 -03:00
ba21aa8b2b
'cpcall' must ensure correct environment for called function
Roberto Ierusalimschy
2009-09-30 17:49:47 -03:00
d119cf3035
a few more instructions to testC (func2udata and getfield)
Roberto Ierusalimschy
2009-09-30 17:49:25 -03:00
0ac3d07ea6
first implementation of lexical environments
Roberto Ierusalimschy
2009-09-30 12:38:37 -03:00
5938212748
information about upvalues (where they come from) kept in Proto structure, instead of sequence of pseudo-opcodes after OP_CLOSURE
Roberto Ierusalimschy
2009-09-28 13:32:50 -03:00
1829911d7c
some operations may shrink g->totalbytes so g->estimate must be more flexible
Roberto Ierusalimschy
2009-09-28 10:50:34 -03:00
cee94df6e0
function list in luaL_register may be NULL for an empty list
Roberto Ierusalimschy
2009-09-28 09:36:40 -03:00
fcc46467fa
limit of constants per function changed to 2^26 using extra arguments to opcodes LOADK, GETGLOBAL, and SETGLOBAL
Roberto Ierusalimschy
2009-09-23 17:33:05 -03:00
f8e354e240
detail (space between function name and its parameter list)
Roberto Ierusalimschy
2009-09-23 17:14:00 -03:00
a650378822
'cpcall' reimplemented as a predefined value in the registry
Roberto Ierusalimschy
2009-09-21 09:09:52 -03:00
99182c6872
references must start after predefined values in the registry
Roberto Ierusalimschy
2009-09-18 15:58:45 -03:00
67cae2854c
'lua_mainthread' replaced by new preregistered value LUA_RIDX_MAINTHREAD
Roberto Ierusalimschy
2009-09-17 15:04:21 -03:00
0e45ffb8e4
first implementation of 'lua_yieldk' (yield with continuation)
Roberto Ierusalimschy
2009-09-14 11:30:39 -03:00
071e54ae0b
extra facilities to testC: comments + commands print, callk and yield + Cfunc with extra upvalues
Roberto Ierusalimschy
2009-09-09 17:44:10 -03:00
a68494fb32
'debug.[gs]etupvalue' should be able to access C upvalues too
Roberto Ierusalimschy
2009-09-09 17:32:19 -03:00
d9fbbe1f23
"file:write" returns "file" in case of success
Roberto Ierusalimschy
2009-09-01 16:10:48 -03:00
4a714cebd1
API checks now have explanatory messages
Roberto Ierusalimschy
2009-08-31 11:26:28 -03:00
5b6be84106
ensures that argument 'mode' to 'io.open' matches "[rwa]%+?b?", to avoid passing invalid modes to 'fopen'.
Roberto Ierusalimschy
2009-08-28 10:51:57 -03:00
b2bb2f7f59
better machinery to test continuations in the C API
Roberto Ierusalimschy
2009-08-26 14:41:26 -03:00
f096ab5421
correct way to check arguments to 'strftime'
Roberto Ierusalimschy
2009-08-25 16:58:08 -03:00
4e1ffc482a
test for 'fs' being NULL at the end of 'close_func' is useless ('fs' cannot be NULl and the new ls->fs can only be NULL when the token is EOS, in which case anchor_token has no effect).
Roberto Ierusalimschy
2009-08-10 17:41:04 -03:00
bc439e21cd
avoid an unprotected call to 'lua_tostring' which theoretically may cause a panicked exit
Roberto Ierusalimschy
2009-08-10 13:23:19 -03:00
1b4480003b
"stange numbers" (-0 and NaN) also go to the constant table (as strings with their binary representation). Therefore, constant folding may produce these results.
Roberto Ierusalimschy
2009-08-10 12:31:44 -03:00
42167804b8
luaH_[gs]etnum renamed to luaH_[gs]etint (as they only accept integers, not generic numbers).
Roberto Ierusalimschy
2009-08-07 14:53:28 -03:00
3135a6bbab
luaH_[gs]etnum renamed to luaH_[gs]etint (as they only accept integers, not generic numbers)
Roberto Ierusalimschy
2009-08-07 13:17:41 -03:00