summaryrefslogtreecommitdiff
path: root/lmem.c
Commit message (Collapse)AuthorAgeFilesLines
* New control for reentrancy of emergency collectionsRoberto Ierusalimschy2021-02-261-13/+12
| | | | | | Instead of assuming that shrinking a block may be an emergency collection, use an explicit field ('gcstopem') to stop emergency collections while GC is working.
* Broadening the use of branch hintsRoberto Ierusalimschy2021-02-241-4/+4
| | | | | | More uses of macros 'likely'/'unlikely' (renamed to 'l_likely'/'l_unlikely'), both in range (extended to the libraries) and in scope (extended to hooks, stack growth).
* New macro 'completestate'Roberto Ierusalimschy2021-02-051-2/+2
|
* Change in macro HARDMEMTESTS for testing GCRoberto Ierusalimschy2020-07-081-1/+1
| | | | | | 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.
* Comments (mosty typos)Roberto Ierusalimschy2019-12-301-1/+1
|
* Some details in 'lmem.c' and 'lgc.c'Roberto Ierusalimschy2019-07-191-24/+38
| | | | | | | | - 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.
* Reviving HARDMEMTESTSRoberto Ierusalimschy2019-07-181-7/+16
| | | | | | | | | | | 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.
* Detail: bad assertion in 'luaM_free_'Roberto Ierusalimschy2018-10-231-1/+1
|
* Removed extra information from RCS keyword stringsRoberto Ierusalimschy2018-08-231-1/+1
| | | | | Version numbers and dates (mostly wrong) from RCS keyword strings removed from all source files; only the file name are kept.
* no need to check whether libraries and host use the same kernel;Roberto Ierusalimschy2018-06-181-2/+2
| | | | Lua should work correctly with several copies of the kernel
* new macros 'likely'/'unlikely' with hints for jump predictionsRoberto Ierusalimschy2018-05-301-17/+27
| | | | (used only in errors for now)
* janitor work on castsRoberto Ierusalimschy2018-01-281-5/+5
|
* 'luaM_shrinkvector' raises an error if it cannot shrink the blockRoberto Ierusalimschy2017-12-111-2/+2
| | | | | (several parts of Lua use array size in protos as proxies for number of valid elements)
* more freedom in handling memory-allocation errors (not all allocationsRoberto Ierusalimschy2017-12-081-9/+21
| | | | | automatically raise an error), which allows fixing a bug when resizing a table.
* using explicit tests for allocation overflow whenever possibleRoberto Ierusalimschy2017-12-071-13/+15
|
* avoid using one function for different tasks (malloc, free, etc.)Roberto Ierusalimschy2017-12-061-11/+66
|
* allocation function is not exactly API (and cannot raise errorsRoberto Ierusalimschy2015-03-061-3/+2
| | | | like other API functions); better not use 'api_check' for cheking it.
* do not attempt emergency collection while building state (it isRoberto Ierusalimschy2015-03-031-3/+5
| | | | useless, and state can be inconsistent)
* comments (references to "ANSI C" changed to "ISO C", which is theRoberto Ierusalimschy2014-11-021-2/+2
| | | | international name
* added include for 'lprefix.h', for stuff that must be added beforeRoberto Ierusalimschy2014-11-021-4/+6
| | | | any other header file
* `name' in comments changed to 'name'Roberto Ierusalimschy2014-10-251-4/+4
|
* removed unused parameter Ä'L' in macro 'api_check' and companyRoberto Ierusalimschy2014-07-151-2/+2
|
* emergency collection can happen even when collector is stoppedRoberto Ierusalimschy2014-06-261-5/+3
|
* removed debug codeRoberto Ierusalimschy2012-05-231-17/+1
|
* avoid 'return' "to avoid warnings"Roberto Ierusalimschy2011-11-301-3/+2
|
* detail in extra trace code: total bytes is given by 'gettotalbytes',Roberto Ierusalimschy2011-09-201-2/+2
| | | | not by 'totalbytes' counter.
* change in the relationship between totalbytes and GCdebt - luaM_realloc_Roberto Ierusalimschy2010-12-201-3/+2
| | | | is too critical to update two counters
* better control for GC running or stoppedRoberto Ierusalimschy2010-12-201-8/+5
|
* typos in commentsRoberto Ierusalimschy2010-05-051-3/+3
|
* changes in patch to monitor garbage collectionRoberto Ierusalimschy2010-05-041-10/+6
|
* wrong commentRoberto Ierusalimschy2010-04-301-2/+2
|
* new way to control GC speedRoberto Ierusalimschy2010-04-291-4/+7
|
* added proper code to trace garbage collectionRoberto Ierusalimschy2010-04-021-1/+23
|
* allocator function receives the tag of object being allocated in 'osize'Roberto Ierusalimschy2009-12-171-9/+9
| | | | when 'ptr' is NULL.
* detailsRoberto Ierusalimschy2006-09-141-3/+3
|
* little better error messages for internal arrays overflowsRoberto Ierusalimschy2006-09-141-2/+2
|
* emergency garbage collector (core forces a GC when allocation fails)Roberto Ierusalimschy2006-07-111-6/+19
|
* removal of dead codeRoberto Ierusalimschy2005-12-261-17/+1
|
* detailsRoberto Ierusalimschy2005-02-231-8/+8
|
* auxiliar patch to monitor garbage collectionRoberto Ierusalimschy2005-01-141-1/+17
|
* better control of overflows in size computationsRoberto Ierusalimschy2004-12-011-8/+6
|
* better control over memory-size overflowsRoberto Ierusalimschy2004-11-191-8/+13
|
* better control for GC cyclesRoberto Ierusalimschy2004-08-301-3/+2
|
* new scheme for configuration through `luaconf.h'Roberto Ierusalimschy2004-04-301-1/+2
|
* avoid overflow when doubling sizeRoberto Ierusalimschy2003-11-271-8/+11
|
* Lua kernel does not use malloc/free functions.Roberto Ierusalimschy2003-10-021-38/+27
|
* each .c file defines its own nameRoberto Ierusalimschy2002-12-041-1/+3
|
* global_State must be deallocated (and so allocated) with NULL alsoRoberto Ierusalimschy2002-11-211-2/+4
| | | | (otherwise it trys to decrement inside itself after its own free)
* assertion must be always valid (not only in debug mode)Roberto Ierusalimschy2002-10-251-1/+2
|
* new ANSI C does not assure that realloc(p,0) == free(p)Roberto Ierusalimschy2002-10-081-6/+13
|