aboutsummaryrefslogtreecommitdiff
path: root/py/gc.h
AgeCommit message (Collapse)Author
2016-07-01py/gc: Calculate (and report) maximum contiguous free block size.Paul Sokolovsky
Just as maximum allocated block size, it's reported in allocation units (not bytes).
2015-11-29py/gc: Move away from using mp_uint_t, instead use uintptr_t and size_t.Damien George
The GC works with concrete pointers and so the types should reflect this.
2015-11-07py: Clear finalizer flag when calling gc_free.Dave Hylands
Currently, the only place that clears the bit is in gc_collect. So if a block with a finalizer is allocated, and subsequently freed, and then the block is reallocated with no finalizer then the bit remains set. This could also be fixed by having gc_alloc clear the bit, but I'm pretty sure that free is called way less than alloc, so doing it in free is more efficient.
2015-07-14py: Improve allocation policy of qstr data.Damien George
Previous to this patch all interned strings lived in their own malloc'd chunk. On average this wastes N/2 bytes per interned string, where N is the number-of-bytes for a quanta of the memory allocator (16 bytes on 32 bit archs). With this patch interned strings are concatenated into the same malloc'd chunk when possible. Such chunks are enlarged inplace when possible, and shrunk to fit when a new chunk is needed. RAM savings with this patch are highly varied, but should always show an improvement (unless only 3 or 4 strings are interned). New version typically uses about 70% of previous memory for the qstr data, and can lead to savings of around 10% of total memory footprint of a running script. Costs about 120 bytes code size on Thumb2 archs (depends on how many calls to gc_realloc are made).
2015-01-07py: Put all global state together in state structures.Damien George
This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
2015-01-01py: Move to guarded includes, everywhere in py/ core.Damien George
Addresses issue #1022.
2014-10-31py: Make gc.enable/disable just control auto-GC; alloc is still allowed.Damien George
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.
2014-10-24py: Improve memory usage debugging; better GC AT dumping.Damien George
In unix port, mem_info(1) now prints pretty GC alloc table.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-06-30Try not to cause a MemoryError when raising an exception during nterrupt ↵Dave Hylands
handling. Step 1 fixes #732
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-04-08py: Improve GC locking/unlocking, and make it part of the API.Damien George
2014-04-05Improve GC finalisation code; add option to disable it.Damien George
2014-04-03Implement delmux
2014-02-26GC: Fix printf formats for debugging; add gc_dump_alloc_table.Damien George
2014-02-11Add prototype for gc_dump_info().Paul Sokolovsky
2013-10-23Fix func decls with no arguments: () -> (void).Damien
2013-10-22Add gc_free function to force a block to be freed.Damien
2013-10-22Clear ATBs on gc_init; better gc_info.Damien
2013-10-21Add mark-sweep garbage collector.Damien