| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Function broke in two and some checks moved to the caller. (We may
want to call it without the checks.)
|
|
|
|
|
|
|
|
|
|
| |
Instead of using 'alimit' for keeping the size of the array and at
the same time being a hint for '#t', a table now keeps these two
values separate. The Table structure has a field 'asize' with the
size of the array, while the length hint is kept in the array itself.
That way, tables with no array part waste no space with that field.
Moreover, the space for the hint may have zero cost for small arrays,
if the array of tags plus the hint still fits in a single word.
|
|
|
|
|
| |
It converts a Lua number to a string in a buffer, without creating
a new Lua string.
|
|
|
|
| |
Memory is the resource we want to save. Still to be reviewed again.
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
|
|
|
|
|
| |
Several definitions that don't need to be "global" (that is, that
concerns only specific parts of the code) moved out of llimits.h,
to more appropriate places.
|
|
|
|
|
|
| |
This "linear" representation (see ltable.h for details) has worse
locality than cells, but the simpler access code seems to compensate
that.
|
|
|
|
| |
Bug introduced in 05932567.
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
- back with step size in collectgarbage("step")
- adjustments in defaults for some GC parameters
- adjustments in 'luaO_codeparam'
|
|
|
|
|
| |
This encoding brings more precision and a larger range for these
parameters.
|
|
|
|
|
| |
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.
|
|
|
|
| |
Strings can use external buffers to store their contents.
|
|
|
|
| |
Long strings have a pointer to string contents.
|
|\ |
|
| |\ |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
A fixed buffer keeps a binary chunk "forever", so that the program
does not need to copy some of its parts when loading it.
|
| | |
| | |
| | |
| | | |
Accesses content and length of a 'TString'.
|
| | |
| | |
| | |
| | | |
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.
|
|\| |
|
| | |
|
|/
|
|
|
| |
Only tables with some minimum number of entries in their hash part
have a 'lastfree' field, kept in a header before the node vector.
|
|
|
|
|
|
|
| |
To avoid the need of both the old and the new stack addresses valid
at the same time, to correct the pointers to the stack, these pointers
are changed to offsets before the reallocation and then changed back
to pointers after the reallocation.
|
|
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
| |
|
|
|
|
| |
That structure can be packed in the future.
|
|
|
|
| |
Comments and small improvements in the manual.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fixes a bug, by removing dummy nodes together with the node
itself. (The previous implementation could leave dummy nodes in frames
which otherwise had no tbc variables, and therefore would not close
variables; that could leave 'tbclist' pointing higher than 'top', which
could dangle if the stack shrank.)
- Computes MAXDELTA based on the type of delta, to ease changing its
type if needed.
- Instead of 'isdummy', uses 'delta==0' to signal dummy nodes. (Dummy
nodes always have MAXDELTA for their real delta.)
|
|
|
|
|
|
|
|
| |
To-be-closed variables are linked in their own list, embedded into the
stack elements. (Due to alignment, this information does not change
the size of the stack elements in most architectures.) This new list
does not produce garbage and avoids memory errors when creating tbc
variables.
|
| |
|
|
|
|
|
|
| |
Fixed the bug that a key removed from a table might not be found
again by 'next'. (This is needed to allow keys to be removed during a
traversal.) This bug was introduced in commit 73ec04fc.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Macro 'checkconsistency' replaced by the similar 'checkliveness".
|
|
|
|
|
| |
Use a variable-sized array to store string contents at the end of a
structure 'TString', instead of raw memory.
|
|
|
|
|
| |
Corrected several small details: added 'const', adjusts in tabs x
spaces, removed unused #includes and #defines, misspellings, etc.
|
|
|
|
| |
Variants can use zero for first variant.
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
The old definition did one test for nil, but three tests for the all
too common booleans (and two tests for other values); this definition
does two tests for all values.
|
| |
|
|
|
|
|
| |
It is simpler to signal a to-be-closed upvalue with a boolean flag,
instead of using a different tag.
|
|
|
|
|
|
|
| |
- Macro 'checkliveness' (for debug) always uses 'L', to avoid warnings.
- Some old 'while' changed to 'for' in 'testes/gc.lua'.
- In 'testes/libs/makefile', do not make files depend on 'ltests.h',
which may not even exist.
|
|
|
|
|
|
| |
OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep
the exact size of the array part of the table to be created.
(Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
|
|
|
|
|
| |
Local constant variables initialized with compile-time constants
are optimized away from the code.
|