Roberto Ierusalimschy
56ec432281
Change in macro HARDMEMTESTS for testing GC
Macro HARDMEMTESTS broke in two: HARDMEMTESTS forces a full GC cycle
at every point where the GC can run. New macro EMERGENCYGCTESTS
forces an emergency collection at every memory allocation.
4 years ago
Roberto Ierusalimschy
bd1b87c579
Comments (mosty typos)
5 years ago
Roberto Ierusalimschy
9cdf6b7082
Some details in 'lmem.c' and 'lgc.c'
- Several new comments in 'lmem.c'.
- Both 'luaM_growaux_' and 'luaM_shrinkvector_' use 'luaM_saferealloc_'
to check for errors. Moreover, the use of 'luaM_saferealloc_' makes
'luaM_shrinkvector_' try again if shrink fails (which can happen now).
- In 'checkSizes', save old debt only when needed.
5 years ago
Roberto Ierusalimschy
d36a31e673
Reviving HARDMEMTESTS
This commit brings a new implementation for HARDMEMTESTS, which forces
an emergency GC whenever possible. It also fixes some issues detected
with this option:
- A small bug in lvm.c: a closure could be collected by an emergency
GC while being initialized.
- Some tests: a memory address can be immediatly reused after a GC;
for instance, two consecutive '{}' expressions can return exactly the
same address, if the first one is not anchored.
5 years ago
Roberto Ierusalimschy
ea1322ef54
Detail: bad assertion in 'luaM_free_'
6 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
af70905246
no need to check whether libraries and host use the same kernel;
Lua should work correctly with several copies of the kernel
6 years ago
Roberto Ierusalimschy
34aa0c5bd7
new macros 'likely'/'unlikely' with hints for jump predictions
(used only in errors for now)
7 years ago
Roberto Ierusalimschy
e2b15aa21d
janitor work on casts
7 years ago
Roberto Ierusalimschy
c5ebed7399
'luaM_shrinkvector' raises an error if it cannot shrink the block
(several parts of Lua use array size in protos as proxies for
number of valid elements)
7 years ago
Roberto Ierusalimschy
e663a24ab0
more freedom in handling memory-allocation errors (not all allocations
automatically raise an error), which allows fixing a bug when resizing
a table.
7 years ago
Roberto Ierusalimschy
7622373033
using explicit tests for allocation overflow whenever possible
7 years ago
Roberto Ierusalimschy
49dfaf7447
avoid using one function for different tasks (malloc, free, etc.)
7 years ago
Roberto Ierusalimschy
bb4baa73ea
allocation function is not exactly API (and cannot raise errors
like other API functions); better not use 'api_check' for cheking it.
10 years ago
Roberto Ierusalimschy
b9a1f27250
do not attempt emergency collection while building state (it is
useless, and state can be inconsistent)
10 years ago
Roberto Ierusalimschy
e75c0148c3
comments (references to "ANSI C" changed to "ISO C", which is the
international name
10 years ago
Roberto Ierusalimschy
28fdbcf393
added include for 'lprefix.h', for stuff that must be added before
any other header file
10 years ago
Roberto Ierusalimschy
bdf566a8a3
`name' in comments changed to 'name'
10 years ago
Roberto Ierusalimschy
5bbb4a06a6
removed unused parameter Ä'L' in macro 'api_check' and company
10 years ago
Roberto Ierusalimschy
7cc40851e1
emergency collection can happen even when collector is stopped
11 years ago
Roberto Ierusalimschy
e131eb0d9a
removed debug code
13 years ago
Roberto Ierusalimschy
e21b26a964
avoid 'return' "to avoid warnings"
13 years ago
Roberto Ierusalimschy
12ab78aca6
detail in extra trace code: total bytes is given by 'gettotalbytes',
not by 'totalbytes' counter.
13 years ago
Roberto Ierusalimschy
551b076f1c
change in the relationship between totalbytes and GCdebt - luaM_realloc_
is too critical to update two counters
14 years ago
Roberto Ierusalimschy
737f119187
better control for GC running or stopped
14 years ago
Roberto Ierusalimschy
237f755dca
typos in comments
15 years ago
Roberto Ierusalimschy
e7ce7e1850
changes in patch to monitor garbage collection
15 years ago
Roberto Ierusalimschy
9a9fe42deb
wrong comment
15 years ago
Roberto Ierusalimschy
3410dcd375
new way to control GC speed
15 years ago
Roberto Ierusalimschy
e54668b696
added proper code to trace garbage collection
15 years ago
Roberto Ierusalimschy
0bbdddc86b
allocator function receives the tag of object being allocated in 'osize'
when 'ptr' is NULL.
15 years ago
Roberto Ierusalimschy
bd869c7b31
details
18 years ago
Roberto Ierusalimschy
d5a23dde90
little better error messages for internal arrays overflows
18 years ago
Roberto Ierusalimschy
3ca9af51a4
emergency garbage collector (core forces a GC when allocation fails)
19 years ago
Roberto Ierusalimschy
0160591998
removal of dead code
19 years ago
Roberto Ierusalimschy
d55bb795fa
details
20 years ago
Roberto Ierusalimschy
8e346d875a
auxiliar patch to monitor garbage collection
20 years ago
Roberto Ierusalimschy
97e2dab1fb
better control of overflows in size computations
20 years ago
Roberto Ierusalimschy
6f1ea817f5
better control over memory-size overflows
20 years ago
Roberto Ierusalimschy
0b06241483
better control for GC cycles
20 years ago
Roberto Ierusalimschy
b4cd38ba6c
new scheme for configuration through `luaconf.h'
21 years ago
Roberto Ierusalimschy
da61624756
avoid overflow when doubling size
21 years ago
Roberto Ierusalimschy
b97fb932ec
Lua kernel does not use malloc/free functions.
21 years ago
Roberto Ierusalimschy
27c6b4d422
each .c file defines its own name
22 years ago
Roberto Ierusalimschy
d404f0c276
global_State must be deallocated (and so allocated) with NULL also
(otherwise it trys to decrement inside itself after its own free)
22 years ago
Roberto Ierusalimschy
f36038e42a
assertion must be always valid (not only in debug mode)
22 years ago
Roberto Ierusalimschy
02afc892d5
new ANSI C does not assure that realloc(p,0) == free(p)
22 years ago
Roberto Ierusalimschy
1dbe708aa8
new protocol for error handling
23 years ago
Roberto Ierusalimschy
6b8cdc9cdd
Lua now uses only `realloc' for all its memory management
23 years ago
Roberto Ierusalimschy
b7a0503c1d
new format for error messages
23 years ago