summaryrefslogtreecommitdiffstatshomepage
path: root/py/gc.c
Commit message (Collapse)AuthorAge
* py: Make gc.enable/disable just control auto-GC; alloc is still allowed.Damien George2014-10-31
| | | | | | gc.enable/disable are now the same as CPython: they just control whether automatic garbage collection is enabled or not. If disabled, you can still allocate heap memory, and initiate a manual collection.
* py: Improve memory usage debugging; better GC AT dumping.Damien George2014-10-24
| | | | In unix port, mem_info(1) now prints pretty GC alloc table.
* py: Properly free string parse-node; add assertion to gc_free.Damien George2014-10-23
|
* py: Clean up edge cases of malloc/realloc/free.Damien George2014-10-23
|
* py: Add more debug printing code in gc_dump_alloc_table.Damien George2014-10-17
|
* py: Take gc_pool_start out of bss section, to reclaim 1st block of heap.Damien George2014-10-16
|
* py: Fix GC realloc issue, where memory chunks were never shrunk.Damien George2014-10-15
| | | | | Previously, a realloc to a smaller memory chunk size would not free the unused blocks in the tail of the chunk.
* py, gc: Further reduce heap fragmentation with new, faster gc alloc.Damien George2014-08-28
| | | | | | | | | | | The heap allocation is now exactly as it was before the "faster gc alloc" patch, but it's still nearly as fast. It is fixed by being careful to always update the "last free block" pointer whenever the heap changes (eg free or realloc). Tested on all tests by enabling EXTENSIVE_HEAP_PROFILING in py/gc.c: old and new allocator have exactly the same behaviour, just the new one is much faster.
* py: Reduce fragmentation of GC heap.Damien George2014-08-28
| | | | | | | | | | | Recent speed up of GC allocation made the GC have a fragmented heap. This patch restores "original fragmentation behaviour" whilst still retaining relatively fast allocation. This patch works because there is always going to be a single block allocated now and then, which advances the gc_last_free_atb_index pointer often enough so that the whole heap doesn't need scanning. Should address issue #836.
* py: Speed up GC allocation.Damien George2014-08-22
| | | | | | | | | This simple patch gives a very significant speed up for memory allocation with the GC. Eg, on PYBv1.0: tests/basics/dict_del.py: 3.55 seconds -> 1.19 seconds tests/misc/rge_sm.py: 15.3 seconds -> 2.48 seconds
* py: Fix bug where GC finaliser table was not completely zeroed out.Damien George2014-08-08
| | | | | | | | | | | | This was a nasty bug to track down. It only had consequences when the heap size was just the right size to expose the rounding error in the calculation of the finaliser table size. And, a script had to allocate a small (1 or 2 cell) object at the very end of the heap. And, this object must not have a finaliser. And, the initial state of the heap must have been all bits set to 1. All these conspire on the pyboard, but only if your run the script fresh (so unused memory is all 1's), and if your script allocates a lot of small objects (eg 2-char strings that are not interned).
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* Try not to cause a MemoryError when raising an exception during nterrupt ↵Dave Hylands2014-06-30
| | | | | | handling. Step 1 fixes #732
* py: Include mpconfig.h before all other includes.Paul Sokolovsky2014-06-21
| | | | | | It defines types used by all other headers. Fixes #691.
* gc: Turn off debugging info againstijn2014-06-18
|
* gc: Keep debug statements at beginning of scope where possiblestijn2014-06-18
|
* gc: More verbose debuggingstijn2014-06-16
| | | | Add more DEBUG_printf statements to trace gc behaviour
* py, gc: Revert ret_ptr to void*, casting to byte* for memset.Damien George2014-06-13
|
* gc: Use byte* pointers instead of void* for pointer arithmeticstijn2014-06-13
| | | | void* is of unknown size
* modgc: Implement return value for gc.collect(), enable on Unix.Paul Sokolovsky2014-06-05
|
* py: Compress a little the bytecode emitter structure.Damien George2014-05-10
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* py, gc: Only zero out the extra bytes at the end of the heap chunk.Damien George2014-04-26
| | | | | This is a small optimisation to zero out only the additional bytes that the caller did not ask for.
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-04-25
|\
| * py, gc: Fix old gc_realloc for case when NULL is passed in as ptr.Damien George2014-04-25
| |
* | py, gc: Zero out newly allocated blocks in the GC.Damien George2014-04-25
|/ | | | | | | | | | | | | | | | | | | | | | | | Also add some more debugging output to gc_dump_alloc_table(). Now that newly allocated heap is always zero'd, maybe we just make this a policy for the uPy API to keep it simple (ie any new implementation of memory allocation must zero all allocations). This follows the D language philosophy. Before this patch, a previously used memory block which had pointers in it may still retain those pointers if the new user of that block does not actually use the entire block. Eg, if I want 5 blocks worth of heap, I actually get 8 (round up to nearest 4). Then I never use the last 3, so they keep their old values, which may be pointers pointing to the heap, hence preventing GC. In rare (or maybe not that rare) cases, this leads to long, unintentional "linked lists" within the GC'd heap, filling it up completely. It's pretty rare, because you have to reuse exactly that memory which is part of this "linked list", and reuse it in just the right way. This should fix issue #522, and might have something to do with issue #510.
* gc: gc_realloc(): Fix byte-to-block calculation.Paul Sokolovsky2014-04-20
|
* py, gc: Further simplify coding-style of gc_realloc.Damien George2014-04-20
| | | | No logic changes, just coding style to make it easy to read.
* gc: "new" gc_realloc: Rewrite in plain C, fixing bunch of bugs.Paul Sokolovsky2014-04-20
| | | | | | There were typos, various rounding errors trying to do concurrent counting in bytes vs blocks, complex conditional paths, superfluous variables, etc., etc., all leading to obscure segfaults.
* gc: Recover simple gc_realloc implementation, make easier to switch between.Paul Sokolovsky2014-04-20
|
* gc.c: Remove superfluous typedef (bute defined in misc.h).Paul Sokolovsky2014-04-09
|
* py: Improve GC locking/unlocking, and make it part of the API.Damien George2014-04-08
|
* Improve GC finalisation code; add option to disable it.Damien George2014-04-05
|
* Merge pull request #425 from iabdalkader/delDamien George2014-04-05
|\ | | | | Implement del
| * Move del to localsmux2014-04-05
| |
| * Implement delmux2014-04-03
| |
* | gc: Uses uint defined in misc.h.Paul Sokolovsky2014-04-02
|/
* py: Fix up so that it can compile without float.Damien George2014-04-02
|
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* py: Cosmetic changes.Damien George2014-03-12
|
* Fix reallocmux2014-03-12
|
* py: Revert to old gc_realloc for now.Damien George2014-03-07
|
* py: Add comments to new gc_realloc, it has some bugs.Damien George2014-03-06
|
* py: Small cosmetic changes to gc_realloc.Damien George2014-03-06
|
* Fix gc_realloc to expand in placemux2014-03-05
| | | | * Issue #322
* GC: Fix printf formats for debugging; add gc_dump_alloc_table.Damien George2014-02-26
|
* py: Remove more var arg names fro macros with var args.Damien George2014-02-26
|
* Make DEBUG_printf() a proper function, implementation is port-dependent.Paul Sokolovsky2014-02-16
| | | | | In particular, unix outputs to stderr, to allow to run testsuite against micropython built with debug output (by redirecting stderr to /dev/null).
* Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky2014-02-12
|
* More GC debugging improvements.Paul Sokolovsky2014-02-11
|