c5fcba1a17
detail (changing some names of macros)
Roberto Ierusalimschy
2013-10-07 11:20:31 -03:00
4c6dfc342b
CallInfo lists shrinks together with their associated stacks
Roberto Ierusalimschy
2013-09-17 12:40:06 -03:00
686e57cf9c
GC local pause configurable
Roberto Ierusalimschy
2013-09-13 13:21:52 -03:00
06156e7575
detail (setmetatable do not need to use a back GC barrier)
Roberto Ierusalimschy
2013-09-11 17:15:31 -03:00
2e2c109daf
type of 'refcount' changed to lu_mem (to ensure there will be no overflows)
Roberto Ierusalimschy
2013-09-11 12:17:00 -03:00
6ca7b63bce
check for shrinking string table done only at the end of a GC cycle
Roberto Ierusalimschy
2013-09-11 11:56:15 -03:00
4eeb1831be
new names and better order for GC states (sweep first lists that can have dead objects)
Roberto Ierusalimschy
2013-09-11 11:47:08 -03:00
dd373a8f66
threads are kept in a separated GC list, linked after the main thread
Roberto Ierusalimschy
2013-09-11 11:09:55 -03:00
7061fe1d56
detail: 'sweepstep' checks end of phase after calling 'sweeplist', so that phases with small lists return 0 at the first call to 'sweepstep'
Roberto Ierusalimschy
2013-09-11 10:24:55 -03:00
d8aa8dd97e
objects in list 'tobefnz' have a GC life-cycle like all others (specifically they are cleaned during sweep phase)
Roberto Ierusalimschy
2013-09-11 09:47:48 -03:00
1150873447
'luaC_newobj' does not handle special cases; only special case now is threads, which do not use 'luaC_newobj' anymore.
Roberto Ierusalimschy
2013-09-11 09:26:14 -03:00
79ab21be90
more invariants added to memory check
Roberto Ierusalimschy
2013-09-11 09:26:14 -03:00
d3bbb34c24
back to open hashing for the string table (but with a different 'hnext' field, to strings are still collected like all other objects)
Roberto Ierusalimschy
2013-09-05 16:31:49 -03:00
0ad15fc100
better (and correct!) control of 'maybedead'
Roberto Ierusalimschy
2013-09-04 12:34:24 -03:00
aeff4f79fa
local collection now calls finalizers
Roberto Ierusalimschy
2013-09-03 12:37:10 -03:00
1bf4faec64
new GC state to sweep 'localgc' list + small changes in sweep control
Roberto Ierusalimschy
2013-08-30 16:14:26 -03:00
8ef9e8460e
bug (GC can collect long identifier during parser) + change (using a single constant table for all functions in a chunk)
Roberto Ierusalimschy
2013-08-30 13:01:37 -03:00
4f292d753c
bug: GC can collect a long string still in use during parser
Roberto Ierusalimschy
2013-08-30 12:51:12 -03:00
26629d0af1
details (a few casts moved from macro invocation to macro definition)
Roberto Ierusalimschy
2013-08-29 10:49:57 -03:00
b5e75fde4e
bug: local collection must clear rest of stack
Roberto Ierusalimschy
2013-08-29 10:34:16 -03:00
9a871dd3db
tables and userdata all go to local list, too
Roberto Ierusalimschy
2013-08-28 15:30:26 -03:00
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
Roberto Ierusalimschy
2013-08-27 17:04:00 -03:00
742b7377d3
Lua closures go to local, too
Roberto Ierusalimschy
2013-08-26 09:41:10 -03:00
50955e27f5
C functions and strings now go to the local list; first version of the local collector
Roberto Ierusalimschy
2013-08-23 10:34:54 -03:00
33c49f7fa0
some details over new implementation of string table
Roberto Ierusalimschy
2013-08-22 12:21:48 -03:00
0df6635711
"fixed" objects kept in a separated list (instead of being kept in 'allgc' list with a bit marking them)
Roberto Ierusalimschy
2013-08-21 17:09:51 -03:00
ae800656c9
change in string table: string table is now independent of GC lists; all strings live in 'normal' GC lists
Roberto Ierusalimschy
2013-08-21 16:21:16 -03:00
8c68863960
initial size of string table (MINSTRTABSIZE) should be large enough to hold all strings needed by an empty Lua state
Roberto Ierusalimschy
2013-08-21 16:02:30 -03:00
8f6b80aa1d
GC bits SEPARATED and FINALIZEDBIT mixed in FINALIZEDBIT (with simpler control)
Roberto Ierusalimschy
2013-08-20 14:46:34 -03:00
9eff921f8f
"barrier" for link prototype->cache changed to be consistent with GC behavior (link is cleared to preserve invariant)
Roberto Ierusalimschy
2013-08-19 11:18:43 -03:00
8e6b7ef9ab
new function 'isgclocal' + test for GC consistency of prototype's caches
Roberto Ierusalimschy
2013-08-19 11:16:33 -03:00
caceeab750
'next' field for tables changed from pointer to integer (for better alignment on 64-bit machines)
Roberto Ierusalimschy
2013-08-18 13:12:18 -03:00
439d74e29f
added 'local' bit (true => object is only refered by local variables)
Roberto Ierusalimschy
2013-08-16 15:55:49 -03:00
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')
Roberto Ierusalimschy
2013-08-13 14:36:44 -03:00
78b941039d
change to allow collector to stop when it goes to the atomic phase (just for debugging)
Roberto Ierusalimschy
2013-08-07 12:39:09 -03:00
623e388bb4
double-linked list of all upvalues elliminated and changed to a traversal of all non-marked threads
Roberto Ierusalimschy
2013-08-07 09:18:11 -03:00
677d90165f
no more generational collection !!!
Roberto Ierusalimschy
2013-08-05 13:58:28 -03:00
fcf99bf788
'math.isfloat' replaced by 'debug.subtype'
Roberto Ierusalimschy
2013-07-10 17:57:05 -03:00
98d76cdcae
bug: Wrong error message in some short-cut expressions
Roberto Ierusalimschy
2013-07-10 17:32:36 -03:00
2f8c51a552
use unsigneds for unary minus, too
Roberto Ierusalimschy
2013-07-10 14:15:12 -03:00
b5f5fcd782
use different constants (instead of different values for the same constant) to define number sizes (LUA_INT_INT/LUA_INT_LONG/LUA_INT_LONGLONG and LUA_REAL_FLOAT/LUA_REAL_DOUBLE/LUA_REAL_LONGDOUBLE) + use __int64 and I64 instead of long long (and ll) for Windows
Roberto Ierusalimschy
2013-07-09 15:31:35 -03:00
2ef9bcfd11
avoid undefined shift of LUA_NBITS in rotate operation
Roberto Ierusalimschy
2013-07-09 15:31:01 -03:00
5fa680d47f
no need for type 'b_uint' (lua_Unsigned must have at least 32 bits)
Roberto Ierusalimschy
2013-07-09 14:49:50 -03:00
48735da0d0
When loading a file, Lua may call the reader function again after it returned end of input + luac listings choke on long strings
Roberto Ierusalimschy
2013-07-05 15:02:28 -03:00
2b4bd21585
'tonumber': base must be a number
Roberto Ierusalimschy
2013-07-05 11:39:15 -03:00
beff5b078a
'tonumber': does not accept numbers when given a base + convertion from strings to numbers with a base moved to a separated function (more modular)
Roberto Ierusalimschy
2013-07-05 11:35:49 -03:00
5519c98655
'lua_cvtonum' -> 'lua_strtonum'; converts only strings to numbers
Roberto Ierusalimschy
2013-07-05 11:29:51 -03:00
cbe164191c
new function 'ifloor'
Roberto Ierusalimschy
2013-07-03 14:23:19 -03:00
66d046833d
no need to check "bad conversion number->int;" in luaL_checkversion, as now Lua does not use tricks for the conversion, but there is a need to check the sizes of number types, as they can be different in two modules
Roberto Ierusalimschy
2013-06-27 15:32:33 -03:00
15fdbd26fe
'numbits' moved from 'math' to 'debug' library
Roberto Ierusalimschy
2013-06-25 16:37:00 -03:00
2b4975dca7
LUA_SMALL_* changed to LUA_*SIZE + added support for long double + better support for ANSI systems
Roberto Ierusalimschy
2013-06-25 16:04:40 -03:00
e39da66c8c
macro 'lua_strx2number' does not need to be global
Roberto Ierusalimschy
2013-06-25 15:58:32 -03:00
483c2ccd0f
avoid using raw representation of numbers for hashing, as number may not use all its space (e.g., long double can have sizeof=12 but use only 10 bytes)
Roberto Ierusalimschy
2013-06-25 15:57:18 -03:00
982aa7058f
'luaL_len' returns lua_Integer instead of 'int'
Roberto Ierusalimschy
2013-06-25 11:05:26 -03:00
80cdf39d0e
avoid using 'modf' in the implementation of 'math.modf', to avoid problems with 'double*'. (When using 'float' as lua_Number, 'float*' is not compatible with 'double*'...)
Roberto Ierusalimschy
2013-06-25 11:02:18 -03:00
45f3797a5b
'long' may have more than 32 bits in some machines; use 'int' for small lua_Integer unless necessary to use 'long'
Roberto Ierusalimschy
2013-06-21 14:42:28 -03:00
de6e5a5919
small bugs uncovered in a 64-bit machine (where 'long' has 64 bits)
Roberto Ierusalimschy
2013-06-21 14:27:24 -03:00
81102d3689
try to avoid warnings when converting int to pointer
Roberto Ierusalimschy
2013-06-20 18:59:13 -03:00
6579bd4190
reorganization of warnings + update of explicit dependencies (gcc -MM)
Roberto Ierusalimschy
2013-06-20 15:56:51 -03:00
f45177f2d3
In the table that hashes constants, use a light userdata as keys to integer values to avoid collisions with floats with the same numerical value
Roberto Ierusalimschy
2013-06-20 14:37:31 -03:00
d6f5fb2d2c
avoid warning for unary minus over an unsigned value
Roberto Ierusalimschy
2013-06-20 12:12:43 -03:00
7c4cc505db
added "reasonable" limit for 'string.rep' (otherwise it is too easy to crash the machine)
Roberto Ierusalimschy
2013-06-20 12:06:51 -03:00
453450d687
new macro 'l_floor' (allows 'floorf' even when other math operations do not have an 'f' variant)
Roberto Ierusalimschy
2013-06-20 12:02:49 -03:00
55f566bd22
use lua_Integer for integer parameters to avoid truncation
Roberto Ierusalimschy
2013-06-19 11:29:01 -03:00
130c0e40e0
new constant 'MAX_SIZE', distinct from 'MAX_SIZET', for sizes visible from Lua; these must fit in a lua_Integer
Roberto Ierusalimschy
2013-06-19 11:27:00 -03:00
6fb0b11350
string contatenation handles conversion of integers to strings + floats always format as floats (with decimal dot or exponent)
Roberto Ierusalimschy
2013-06-04 16:36:42 -03:00
932e7fb0e1
'lua_tounsigned' takes number modulo 2^numbits as a result when number is a float (That may change...)
Roberto Ierusalimschy
2013-06-04 16:34:51 -03:00
188192ce9a
'luai_hashnum' "inlined" into 'hashfloat'
Roberto Ierusalimschy
2013-05-29 11:05:03 -03:00
fc083f1138
removed all tricks for conversions + 'luai_hashnum' moved to ltable.c
Roberto Ierusalimschy
2013-05-29 11:04:15 -03:00
ee865b9fe7
new implementation for 'lua_strx2number' to correct small problems with numbers like 0x10000...000p-100
Roberto Ierusalimschy
2013-05-27 14:42:38 -03:00
d630daca1a
"legal" way to convert a float to an integer in C
Roberto Ierusalimschy
2013-05-27 09:43:37 -03:00
8c883cb4e8
'objlen' can return integers
Roberto Ierusalimschy
2013-05-26 11:47:51 -03:00
c75cca0559
detail (case '%d' of 'luaO_pushvfstring' should use integers)
Roberto Ierusalimschy
2013-05-26 11:43:35 -03:00
1414b7123c
support for the case when 'l_mathop' does not conform to lua_Number (problem with pointers to lua_Number solved by a typedef selected automatically by 'l_mathop')
Roberto Ierusalimschy
2013-05-26 10:45:24 -03:00
3563b3f519
first version of control for number sizes (still in 'local' section)
Roberto Ierusalimschy
2013-05-26 10:35:52 -03:00
d46ed54646
no more IEEE tricks
Roberto Ierusalimschy
2013-05-26 10:26:34 -03:00
e2c8c756ee
removed 'IEEE tricks' (should not be needed in Lua with integers)
Roberto Ierusalimschy
2013-05-23 18:27:06 -03:00
5ca5086c19
'tonumber' now works with integers too
Roberto Ierusalimschy
2013-05-16 15:35:57 -03:00
2d6a0ae149
added patch to last bug
Roberto Ierusalimschy
2013-05-16 13:03:50 -03:00
b5ec26101f
new API function 'lua_cvtonum' to convert a value (number or string) to a number, following the rules of the language to create integers or floats
Roberto Ierusalimschy
2013-05-14 13:00:11 -03:00
36e8771076
'luaO_str2int' more generic: accepts white spaces around the numeral and handles signal
Roberto Ierusalimschy
2013-05-14 12:59:04 -03:00
27f09415e3
new read format "*i" for reading integers
Roberto Ierusalimschy
2013-05-14 12:57:43 -03:00
4ad9970649
uses integers for time
Roberto Ierusalimschy
2013-05-14 12:57:11 -03:00
bef345a4b8
bug: Wrong error message in some short-cut expressions
Roberto Ierusalimschy
2013-05-13 13:17:47 -03:00
0ce3018109
'pushnum' pushes a "number" (float) + new C instruction 'pushint'
Roberto Ierusalimschy
2013-05-07 16:01:16 -03:00
0233ce0815
new function 'math.numbits' (not a final decision)
Roberto Ierusalimschy
2013-05-06 14:22:55 -03:00