Roberto Ierusalimschy
0acd55898d
Added gcc option '-Wconversion'
No warnings for standard numerical types. Still pending alternative
numerical types.
3 months ago
Roberto Ierusalimschy
94b503d95e
Encoding of table indices (hres) must use C indices
As the encoding of array indices is (~index), 0 is encoded as -1 and
INT_MAX is encoded as INT_MIN.
5 months ago
Roberto Ierusalimschy
5edacafcfa
Yet another representation for arrays
This "linear" representation (see ltable.h for details) has worse
locality than cells, but the simpler access code seems to compensate
that.
7 months ago
Roberto Ierusalimschy
9fa63a6268
Some 'unsigned int' changed to 'unsigned'
'unsigned int' is too long sometimes. (We already write 'long' instead
of 'long int'...)
8 months ago
Roberto Ierusalimschy
0593256707
'luaH_get' functions return tag of the result
Undoing previous commit. Returning TValue increases code size without
any visible gains. Returning the tag is a little simpler than returning
a special code (HOK/HNOTFOUND) and the tag is useful by itself in
some cases.
8 months ago
Roberto Ierusalimschy
ce6f5502c9
'luaH_get' functions return 'TValue'
Instead of receiving a parameter telling them where to put the result
of the query, these functions return the TValue directly. (That is,
they return a structure.)
8 months ago
Roberto Ierusalimschy
ba71060381
Removed "bulk operations"
Negligible performance gains don't justify extra complexity.
8 months ago
Roberto Ierusalimschy
3823fc6c81
Added "bulk operations" to arrays
A few operations on arrays can be performed "in bulk", treating all
tags of a cell as a simple (or a few) word(s).
8 months ago
Roberto Ierusalimschy
d862da6d04
Optimizations for 'lua_rawgeti' and 'lua_rawseti'
'lua_rawgeti' now uses "fast track"; 'lua_rawseti' still calls
'luaH_setint', but the latter was recoded to avoid extra overhead
when writing to the array part after 'alimit'.
10 months ago
Roberto Ierusalimschy
52b899d60d
Simpler coding for new representation for arrays
With the tags comming first in a cell, we can define the whole cell
as a C type and let C do part of the address computations.
12 months ago
Roberto Ierusalimschy
b8a9d14032
Details
Comments and parameter name in header file.
1 year ago
Roberto Ierusalimschy
08a077d673
Full implementation of new representation for arrays
1 year ago
Roberto Ierusalimschy
43c8e5bded
Full abstraction for representation of array values
1 year ago
Roberto Ierusalimschy
819bd51d87
Some cleaning in the new table API
2 years ago
Roberto Ierusalimschy
f8d30826dd
New table API for 'set' functions
2 years ago
Roberto Ierusalimschy
351ccd7332
Towards a new implementation of arrays
The array part of a table wastes too much space, due to padding.
To avoid that, we need to store values in the array as something
different from a TValue. Therefore, the API for table access
should not assume that any value in a table lives in a *TValue.
This commit is the first step to remove that assumption: functions
luaH_get*, instead of returning a *TValue where the value lives,
receive a *TValue where to put the value being accessed.
(We still have to change the luaH_set* functions.)
2 years ago
Roberto Ierusalimschy
934e77a286
Details
- Better comments about short strings in opcodes.
- luaH_newkey made static.
2 years ago
Roberto Ierusalimschy
8047b2d03e
Tables have a 'lastfree' information only when needed
Only tables with some minimum number of entries in their hash part
have a 'lastfree' field, kept in a header before the node vector.
2 years ago
Roberto Ierusalimschy
b85816b9a8
Removed test function 'luaH_isdummy'
It was not being used anywhere.
2 years ago
Roberto Ierusalimschy
23051e830a
Changes in the API of 'luaH_set' and related functions
Functions to set values in a table (luaH_set, luaH_newkey, etc.) receive
the new value, instead of returning a slot where to put the value.
4 years ago
Roberto Ierusalimschy
7c3cb71fa4
Free bit 7 of GC 'marked' field
Tables were using this bit to indicate their array sizes were real
('isrealasize'), but this bit can be useful for tests. Instead, they
can use bit 7 of their 'flag' field for that purpose. (There are only
six fast-access metamethods.) This 'flag' field only exists in tables,
so this use does not affect other types.
4 years ago
Roberto Ierusalimschy
0ddc0f47bd
Several details about 5.4.0 rc1
Corrected several small details: added 'const', adjusts in tabs x
spaces, removed unused #includes and #defines, misspellings, etc.
5 years ago
Roberto Ierusalimschy
f99509581e
Removed extra information from RCS keyword strings
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
6 years ago
Roberto Ierusalimschy
6e600695f8
field 'sizearray' in struct 'Table' changed to 'alimit', which can
be used as a hint for '#t'
6 years ago
Roberto Ierusalimschy
fb8fa66136
no more 'luaH_emptyobject' and comparisons of addresses of global variables
(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
7 years ago
Roberto Ierusalimschy
9243c414d9
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
7 years ago
Roberto Ierusalimschy
b6f87491af
in hash nodes, keys are stored in separate pieces to avoid wasting
space with alignments
8 years ago
Roberto Ierusalimschy
e39ee2cc58
'luaH_getn' must return 'lua_Unsigned' (or 'lua_Integer'), to
allow the boundary-search algorithm to use 'maxinteger' when
it cannot find a good upper bound.
8 years ago
Roberto Ierusalimschy
2a235312f0
detail (removing spaces at end of lines)
8 years ago
Roberto Ierusalimschy
7b1fba69b7
using 'lastfree == NULL' to signal that table is using the dummy
node for its hash part + new macro 'allocsizenode'
8 years ago
Roberto Ierusalimschy
46de77b219
bug: despite its name, 'luaH_getstr' did not work for strings in
general, but only for short strings
9 years ago
Roberto Ierusalimschy
3a15c7ce43
size for array part of a table ('sizearray') changed from 'int' to
'unsigned int', which allows twice as many elements in the array part
10 years ago
Roberto Ierusalimschy
07c7fdb9df
simpler definition for 'setobj' (trust the compiler for the assignment)
10 years ago
Roberto Ierusalimschy
8ef9e8460e
bug (GC can collect long identifier during parser) + change (using
a single constant table for all functions in a chunk)
11 years ago
Roberto Ierusalimschy
d4e6b75098
"integer" keys in tables are now lua_Integer, not 'int'.
12 years ago
Roberto Ierusalimschy
89b59eee73
bug: __newindex metamethod may not work if metatable is its own
metatable + luaV_settable does not create entry when there is a
metamethod (and therefore entry is useless)
13 years ago
Roberto Ierusalimschy
92afcf2823
no more 'luaH_setstr (used only once) + 'luaH_setint' receives value
to be set.
13 years ago
Roberto Ierusalimschy
d9ea6eca7c
macro 'key2tal' replaced by 'gkey' (as both were equal)
15 years ago
Roberto Ierusalimschy
fbf866a1a5
macro 'gkey' returns a "real" TValue*
15 years ago
Roberto Ierusalimschy
3135a6bbab
luaH_[gs]etnum renamed to luaH_[gs]etint (as they only accept integers,
not generic numbers)
15 years ago
Roberto Ierusalimschy
3ca9af51a4
emergency garbage collector (core forces a GC when allocation fails)
19 years ago
Roberto Ierusalimschy
f8b7a5581e
avoid unnecessary exports
19 years ago
Roberto Ierusalimschy
ffb798e1e2
avoids type punning for table keys
19 years ago
Roberto Ierusalimschy
d987cf1f81
new mark LUAI_DATA for extern data
20 years ago
Roberto Ierusalimschy
8718fda9b2
added LUAI_FUNC to functions not in the API
20 years ago
Roberto Ierusalimschy
9ffae705ee
new "primitive" getn
20 years ago
Roberto Ierusalimschy
e2498e079e
change in hash algorithm so that it does not need empty slot
(tables can be 100% full)
20 years ago
Roberto Ierusalimschy
65726f3e2e
cleaner interface to `ltable'
20 years ago
Roberto Ierusalimschy
bd38017ddf
small optimization for table size in machines with double allignment
20 years ago
Roberto Ierusalimschy
4c5d7b2ddd
small optimization for {f()}
21 years ago