| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Array sizes are always int and are dumped as int, so there is no reason
to read them back as unsigned.
|
|
|
|
| |
New year (2024->2025), typos in comments
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
|
|
|
| |
(As the length of any string in Lua.)
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
size_t should be big enough to count the number of strings in a dump.
(And, by definition, it is big enough to count the length of each
string.)
|
|
|
|
|
|
|
|
| |
- Usign lua_Unsigned to count strings.
- Varint uses a type large enough both for size_t and lua_Unsigned.
- Most-Significant Bit 0 means last byte, to conform to common usage.
- (unrelated) Change in macro 'getaddr' so that multiplication is
by constants.
|
| |
|
|
|
|
|
| |
'lua_dump' signals to the writer function the end of a dump, so that
is has more freedom when using the stack.
|
|
|
|
|
|
| |
Call to 'luaH_setint' could call the GC with the string unanchored.
Moreover, previously saved strings were being assigned to the prototype
without a barrier.
|
| |
|
|
|
|
|
|
| |
The use of tables in dump/undump to reuse strings did not exist in
the version that changed the representation of arrays, so it was not
corrected for the new API for tables.
|
|\ |
|
| |
| |
| |
| |
| | |
Test is too non portable. (For instance, it does not work for
different number types.)
|
| |
| |
| |
| |
| | |
A fixed buffer keeps a binary chunk "forever", so that the program
does not need to copy some of its parts when loading it.
|
| |
| |
| |
| | |
So that the other bits can be used for other purposes.
|
| | |
|
|\| |
|
| |
| |
| |
| |
| | |
We may want to add other string variants in the future; this change
documents better where the code may need to handle those variants.
|
|\| |
|
| |
| |
| |
| |
| | |
The size of the list of upvalue names are stored separated from the
size of the list of upvalues, but they share the same array.
|
| |
| |
| |
| | |
All strings are being reused now, including 'source'.
|
|/
|
|
|
| |
A repeated string in a dump is represented as an index to its first
occurence, instead of another copy of the string.
|
|
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
|
|
|
|
|
|
| |
When "undumping" a long string, the function 'loadVector' can call the
reader function, which can run the garbage collector, which can collect
the string being read. So, the string must be anchored during the call
to 'loadVector'.
|
|
|
|
|
|
|
|
|
| |
In 'lundump.c', when loading the upvalues of a function, there can be
a read error if the chunk is truncated. In that case, the creation
of the error message can trigger an emergency collection while the
prototype is still anchored. So, the prototype must be GC consistent
before loading the upvales, which implies that it the 'name' fields
must be filled with NULL before the reading.
|
|
|
|
| |
Added as incompatibility, in the manual, the extra return of 'io.lines'.
|
|
|
|
|
| |
While building a new prototype, the GC needs barriers for every object
(strings and nested prototypes) that is attached to the new prototype.
|
|
|
|
|
|
| |
(Undoing part of commit f53eabeed8.) It is better to keep this encoding
stable, so that all Lua versions can read at least the version of a
binary file.
|
|
|
|
|
| |
- function names start with lower case;
- state is always the first parameter.
|
|
|
|
|
| |
LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
|
|
|
|
|
|
|
| |
Instead of an explicit value (field 'b'), true and false use different
tag variants. This avoids reading an extra field and results in more
direct code. (Most code that uses booleans needs to distinguish between
true and false anyway.)
|
|
|
|
|
| |
Local constant variables initialized with compile-time constants
are optimized away from the code.
|
|
|
|
|
|
|
|
|
| |
VLOCAL expressions keep a reference to their corresponding 'Vardesc',
and 'Upvaldesc' (for upvalues) has a field 'ro' (read-only). So, it is
easier to check whether a variable is read-only. The decoupling in
VLOCAL between 'vidx' ('Vardesc' index) and 'sidx' (stack index)
should also help the forthcoming implementation of compile-time
constant propagation.
|
|
|
|
|
| |
The function 'require' returns the *loader data* as a second result.
For file searchers, this data is the path where they found the module.
|
|
|
|
|
|
|
|
|
| |
- LUAC_VERSION is equal to LUA_VERSION_NUM, and it is stored
as an int.
- 'sizeof(int)' and 'sizeof(size_t)' removed from the header, as
the binary format does not depend on these sizes. (It uses its
own serialization for unsigned integer values.)
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
| |
|
| |
|
| |
|
|
|
|
| |
(we may want to put extra info there in the future)
|
| |
|
|
|
|
|
|
| |
values, so that the array can use bytes instead of ints, reducing
its size. (A new array 'abslineinfo' is used when line differences
do not fit in a byte.)
|
|
|
|
| |
in critical time pathes, can save a few bytes without the macro)
|
| |
|
|
|
|
|
| |
(instead of using an auxiliar buffer to first create the string
and then allocate the final string and copy result there)
|
|
|
|
| |
any other header file
|
| |
|
|
|
|
|
| |
parent when they are equal (only possible case for chunks created
by the parser)
|