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
52aa2b5d24
Details
- 'unsigned int' -> 'unsigned'
- Some explicit casts to avoid warnings
- Test avoids printing the value of 'fail' (which may not be nil)
8 months ago
Roberto Ierusalimschy
cc2b66c856
Removed type 'varint_t'
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.)
8 months ago
Roberto Ierusalimschy
65b07dd53d
API asserts for illegal pops of to-be-closed variables
8 months ago
Roberto Ierusalimschy
7237eb3f1c
Fixed warnings from different compilers
9 months ago
Roberto Ierusalimschy
165389b27b
New interface to function 'luaL_openselectedlibs'
Instead of preloading all non-loaded libraries, there is another
mask to select which libraries to preload.
9 months ago
Roberto Ierusalimschy
c8121ce34b
Revising code for Varint encoding in dumps
- 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.
9 months ago
Roberto Ierusalimschy
7360f8d0fd
Removed deprecated function 'setcstacklimit'
9 months ago
Roberto Ierusalimschy
6063c47031
Field 'lastfree' changed (back) to 'Node *'
Due to allignment, it is already using the space of a pointer, and
a pointer generates slightly simpler code.
9 months ago
Roberto Ierusalimschy
0c9bec0d38
Better handling of size limit when resizing a table
Avoid silent conversions from int to unsigned int when calling
'luaH_resize'; avoid silent conversions from lua_Integer to int in
'table.create'; MAXASIZE corrected for the new implementation of arrays;
'luaH_resize' checks explicitly whether new size respects MAXASIZE.
(Even constructors were bypassing that check.)
9 months ago
Roberto Ierusalimschy
c31d6774ac
Details
9 months ago
Roberto Ierusalimschy
108e0bdc84
Merge branch 'master' into nextversion
10 months ago
Roberto Ierusalimschy
b34a97a4af
Small optimization in 'luaH_psetint'
It is quite common to write to empty but existing cells in the array
part of a table, so 'luaH_psetint' checks for the common case that
the table doesn't have a newindex metamethod to complete the write.
10 months ago
Roberto Ierusalimschy
3e9dbe143d
New function 'table.create'
Creates a table preallocating memory. (It just exports to Lua the API
function 'lua_createtable'.)
10 months ago
Roberto Ierusalimschy
4a8e480864
New mechanism to query GC parameters
10 months ago
Roberto Ierusalimschy
17e0c29d9b
Clear interface between references and predefines
The reference system has a defined way to add initial values to the
table where it operates.
10 months ago
Roberto Ierusalimschy
8eb0abc9db
Removed uses of LUA_NUMTAGS
That constant was already deprecated (see commit 6aabf4b15e
).
10 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
e288c5a918
Bug: Yielding in a hook stops in the wrong instruction
Yielding in a hook must decrease the program counter, because it already
counted an instruction that, in the end, was not executed. However,
that decrement should be done only when about to restart the thread.
Otherwise, inspecting the thread with the debug library shows it one
instruction behind of where it really is.
10 months ago
Roberto Ierusalimschy
7827c40c49
A few more tweaks in the garbage collector
10 months ago
Roberto Ierusalimschy
e7af9cdf0b
Fixed buffers reuse absolute line information
11 months ago
Roberto Ierusalimschy
12b6f610b0
Several tweaks in the garbage collector
- back with step size in collectgarbage("step")
- adjustments in defaults for some GC parameters
- adjustments in 'luaO_codeparam'
11 months ago
Roberto Ierusalimschy
e81f586001
Removed compatibility option LUA_COMPAT_GCPARAMS
The meaning of different GC parameters changed, so there is point in
supporting old values for them. The new code simply ignores the
parameters when changing the GC mode, so the incompatibility is small.
11 months ago
Roberto Ierusalimschy
e2cc179454
New option "setparms" for 'collectgarbage'
The generational mode also uses the parameters for the incremental
mode in its major collections, so it should be easy to change those
parameters without having to change the GC mode.
11 months ago
Roberto Ierusalimschy
5853c37a83
Bug: Buffer overflow in string concatenation
Even if the string fits in size_t, the whole size of the TString object
can overflow when we add the header.
11 months ago
Roberto Ierusalimschy
ad0ea7813b
GC parameters encoded as floating-point bytes
This encoding brings more precision and a larger range for these
parameters.
11 months ago
Roberto Ierusalimschy
666e95a66d
Option 0 for step multiplier makes GC non-incremental
11 months ago
Roberto Ierusalimschy
4eda1acafa
Cleaner protocol between 'lua_dump' and writer function
'lua_dump' signals to the writer function the end of a dump, so that
is has more freedom when using the stack.
11 months ago
Roberto Ierusalimschy
ad73b33224
Check minor->major made at the end of a minor cycle
It does not make sense to wait for another cycle to decide when much of
the information about creation of old objects is already available.
11 months ago
Roberto Ierusalimschy
925fe8a0f2
First criteria for shifts minor<->major
11 months ago
Roberto Ierusalimschy
789e7acdea
Major collections done incrementally
Major collections do not need to "stop the world". Still pending:
criteria for shifts minor-major, shifts generational-incremental.
11 months ago
Roberto Ierusalimschy
74b4013538
Removed macro 'changeage'
It is simpler to use always 'setage'. The saving from 'changeage'
is too irrelevant.
11 months ago
Roberto Ierusalimschy
b719ff9399
Removed parameter in 'collectgarbage("step")'
A call to 'collectgarbage("step")' always performs one GC basic step.
11 months ago
Roberto Ierusalimschy
35a2fed2d1
Removed deprecated options in 'lua_gc'
Options 'setpause' and 'setstepmul' were deprecated in Lua 5.4.
11 months ago
Roberto Ierusalimschy
63d68bd657
Comments detailing the ages for generational GC
Plus other comments and small details.
11 months ago
Roberto Ierusalimschy
842a83f09c
Panic functions should not raise errors
The standard panic function was using 'lua_tostring', which may raise
a memory-allocation error if error value is a number.
12 months ago
Roberto Ierusalimschy
011850a8f8
Details in the manual
12 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
25cd3d377e
Buffer in 'luai_makeseed' measured in bytes
In the (rare) cases when sizeof(void*) or sizeof(time_t) are not
multiples of sizeof(int), we still can use all their bytes in the seed.
12 months ago
Roberto Ierusalimschy
1028f296a8
Default paths stored as external strings
12 months ago
Roberto Ierusalimschy
6d042a178f
Auxiliary buffer uses external strings
The buffer system from the auxiliary library reuses its buffer
as external memory when closing long strings.
12 months ago
Roberto Ierusalimschy
eabf425c76
Correct anchoring and GC barriers in 'loadString'
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.
12 months ago
Roberto Ierusalimschy
3b57e37e48
Fixed buffers save long strings as external.
1 year ago
Roberto Ierusalimschy
024f9064f1
External strings
Strings can use external buffers to store their contents.
1 year ago
Roberto Ierusalimschy
7f4906f565
Towards external strings
Long strings have a pointer to string contents.
1 year ago
Roberto Ierusalimschy
b8a9d14032
Details
Comments and parameter name in header file.
1 year ago
Roberto Ierusalimschy
19afd91687
Solving merge issue with use of tables in dump/undump
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.
1 year ago
Roberto Ierusalimschy
37c215b43f
Merge branch 'newarray' into nextversion
1 year ago