Commit Graph

141 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
f230898ad6 tiny code refactoring in 'luaS_hash' 2015-11-23 09:32:51 -02:00
Roberto Ierusalimschy
d356183402 new function 'luaS_hashlongstr' 2015-11-03 13:36:01 -02:00
Roberto Ierusalimschy
df45f7118b detail (added assertion) 2015-10-08 12:53:31 -03:00
Roberto Ierusalimschy
9fae7b6d3f code for string cache generalized for "associative sets" (compiler
will optimize away or inline the extra loops)
2015-09-22 11:18:24 -03:00
Roberto Ierusalimschy
ee5edb6b68 macros 'getaddrstr' and 'getstr' unified (they do the same thing) 2015-09-17 12:51:05 -03:00
Roberto Ierusalimschy
41964648ee long strings are created directly in final position when possible
(instead of using an auxiliar buffer to first create the string
and then allocate the final string and copy result there)
2015-09-08 12:41:05 -03:00
Roberto Ierusalimschy
a5cbb7c3a7 detail (i + 1 > exp is simply i >= exp) 2015-06-18 11:20:32 -03:00
Roberto Ierusalimschy
6645bb2df4 'strcache' elements as arrays of 1 element hints that cache can
be n-way (instead of direct mapped)
2015-06-01 13:34:37 -03:00
Roberto Ierusalimschy
b436ed58a3 'clearapihash' -> 'luaS_clearcache' and moved to 'lstring.c' (which
keeps all code related to this cache)
2015-03-25 10:42:19 -03:00
Roberto Ierusalimschy
a80cada914 new cache for interning strings 2015-03-04 10:31:21 -03: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
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
17ee57f8e0 'iswhite' and related macros now can work directly on any object
(no need to convert to 'GCObject')
2014-07-21 13:02:10 -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
ca41b43f53 type 'TString' refers directly to the structure inside the union
(union used only for size purposes)
2014-07-18 10:36:14 -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
14929f5764 use appropriate macros to convert GCObject to specific types 2014-06-18 19:59:29 -03:00
Roberto Ierusalimschy
f61ceee708 LUAI_FUNC is being used only in header files 2014-04-02 13:44:42 -03:00
Roberto Ierusalimschy
2f5f77788f removed function 'luaS_eqstr' (not used anywhere) 2014-03-19 15:51:42 -03:00
Roberto Ierusalimschy
c86b9da022 userdata can have any Lua value as uservalue 2014-02-19 10:52:42 -03:00
Roberto Ierusalimschy
6ca7b63bce check for shrinking string table done only at the end of a GC cycle 2013-09-11 11:56:15 -03:00
Roberto Ierusalimschy
1150873447 'luaC_newobj' does not handle special cases; only special case
now is threads, which do not use 'luaC_newobj' anymore.
2013-09-11 09:26:14 -03:00
Roberto Ierusalimschy
d3bbb34c24 back to open hashing for the string table (but with a different
'hnext' field, to strings are still collected like all other
objects)
2013-09-05 16:31:49 -03:00
Roberto Ierusalimschy
9a871dd3db tables and userdata all go to local list, too 2013-08-28 15:30:26 -03:00
Roberto Ierusalimschy
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
2013-08-27 17:04:00 -03:00
Roberto Ierusalimschy
50955e27f5 C functions and strings now go to the local list; first version
of the local collector
2013-08-23 10:34:54 -03:00
Roberto Ierusalimschy
33c49f7fa0 some details over new implementation of string table 2013-08-22 12:21:48 -03:00
Roberto Ierusalimschy
ae800656c9 change in string table: string table is now independent of GC lists; all
strings live in 'normal' GC lists
2013-08-21 16:21:16 -03:00
Roberto Ierusalimschy
677d90165f no more generational collection !!! 2013-08-05 13:58:28 -03:00
Roberto Ierusalimschy
130c0e40e0 new constant 'MAX_SIZE', distinct from 'MAX_SIZET', for sizes visible
from Lua; these must fit in a lua_Integer
2013-06-19 11:27:00 -03:00
Roberto Ierusalimschy
0730a56d38 detail 2013-01-08 12:06:55 -02:00
Roberto Ierusalimschy
84b6581287 cast to avoid warning in some compilers (size_t x unsigned int) 2012-10-02 14:41:50 -03:00
Roberto Ierusalimschy
c2361e0b61 definition for 'LUAI_MAXSHORTLEN' moved to luaconf.h (too important) 2012-05-11 11:14:42 -03:00
Roberto Ierusalimschy
cfbe2333a4 string hash may not use all bytes (but this is configurable now) +
small other changes
2012-03-28 15:28:25 -03:00
Roberto Ierusalimschy
678c1255c9 random seed used in the hash of all strings to avoid intentional
collisions
2012-02-01 19:57:15 -02:00
Roberto Ierusalimschy
a4b96ce9a3 first implementation of long strings 2012-01-25 19:05:40 -02:00
Roberto Ierusalimschy
291f564485 field 'reserved' -> 'extra' (may be used for other purposes too) 2012-01-23 21:05:51 -02:00
Roberto Ierusalimschy
ad2531a0ee more complete (and hopefuly more correct) handling of 'sizeof(char)' 2011-05-03 13:01:57 -03:00
Roberto Ierusalimschy
1c1a98e872 corrected some places where an old object could end up in front
of a new one + minimal documentation about this problem
2010-05-10 15:23:45 -03:00
Roberto Ierusalimschy
f80ff7a336 'luaS_new' changed from macro to function 2010-04-03 17:24:18 -03:00
Roberto Ierusalimschy
0bbdddc86b allocator function receives the tag of object being allocated in 'osize'
when 'ptr' is NULL.
2009-12-17 13:46:44 -02:00
Roberto Ierusalimschy
8da245bfd2 better to keep GC state numbers sequential, to optimize switch in
'singlestep'
2009-12-11 19:31:14 -02:00
Roberto Ierusalimschy
a2a2abcba4 new function 'luaC_runtilstate' to advance GC until a "valid" state 2009-12-11 17:14:59 -02:00
Roberto Ierusalimschy
ea44570883 hash table for strings is rehashed in place 2009-04-29 14:09:41 -03:00
Roberto Ierusalimschy
c6b442bd36 'luaM_freearray' does not need array type as argument 2009-04-17 11:40:13 -03:00
Roberto Ierusalimschy
e2b366c760 userdata with finalizers are kept in a separated list 2008-02-19 15:55:09 -03:00
Roberto Ierusalimschy
62790ab15d detail 2007-11-09 16:55:07 -02:00
Roberto Ierusalimschy
3ca9af51a4 emergency garbage collector (core forces a GC when allocation fails) 2006-07-11 12:53:29 -03:00
Roberto Ierusalimschy
c505f341d6 small changes in casts 2005-12-22 14:19:56 -02:00
Roberto Ierusalimschy
7d45a5f48f C functions and userdata also have environments 2005-02-18 10:40:02 -02:00