<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/gc.c, branch azure</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=azure</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=azure'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-03-12T21:05:31+00:00</updated>
<entry>
<title>Fix function signature</title>
<updated>2019-03-12T21:05:31+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-03-12T21:05:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=911509c80c0767bed81a4a3757c7691af9be19ea'/>
<id>urn:sha1:911509c80c0767bed81a4a3757c7691af9be19ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Enter safe mode when an allocation is attempted on an uninitialized heap.</title>
<updated>2019-03-12T18:18:26+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-03-08T23:29:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=03be42ab847f04a89d207d98fdb28048cfedf72d'/>
<id>urn:sha1:03be42ab847f04a89d207d98fdb28048cfedf72d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>WIP: after merge; before testing</title>
<updated>2018-07-11T20:45:30+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-07-11T20:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7c219600a246d8956d0b23ea3f5d125a820e6b6a'/>
<id>urn:sha1:7c219600a246d8956d0b23ea3f5d125a820e6b6a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Analysis fixes and long lived tweaks.</title>
<updated>2018-07-03T12:45:50+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-06-27T18:17:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=252aacdddf1aae89e3ebe91ca72a3ad666728e37'/>
<id>urn:sha1:252aacdddf1aae89e3ebe91ca72a3ad666728e37</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/gc: Add gc_sweep_all() function to run all remaining finalisers.</title>
<updated>2018-06-12T01:55:29+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-31T13:10:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=522ea80f06a80fd799bd57de351373ceaeeae325'/>
<id>urn:sha1:522ea80f06a80fd799bd57de351373ceaeeae325</id>
<content type='text'>
This patch adds the gc_sweep_all() function which does a garbage collection
without tracing any root pointers, so frees all the memory, and most
importantly runs any remaining finalisers.

This helps primarily for soft reset: it will close any open files, any open
sockets, and help to get the system back to a clean state upon soft reset.
</content>
</entry>
<entry>
<title>py/gc: When GC threshold is hit don't unnecessarily collect twice.</title>
<updated>2018-05-21T03:36:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-21T03:36:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6bd78741c13849da0570710ad6df80846df812c0'/>
<id>urn:sha1:6bd78741c13849da0570710ad6df80846df812c0</id>
<content type='text'>
Without this, if GC threshold is hit and there is not enough memory left to
satisfy the request, gc_collect() will run a second time and the search for
memory will happen again and will fail again.

Thanks to @adritium for pointing out this issue, see #3786.
</content>
</entry>
<entry>
<title>py/mpstate.h: Adjust start of root pointer section to exclude non-ptrs.</title>
<updated>2018-05-13T12:53:28+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-12T12:09:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=749b16174b5292b2680ab027a6a1b3874e22ea43'/>
<id>urn:sha1:749b16174b5292b2680ab027a6a1b3874e22ea43</id>
<content type='text'>
This patch moves the start of the root pointer section in mp_state_ctx_t
so that it skips entries that are not pointers and don't need scanning.

Previously, the start of the root pointer section was at the very beginning
of the mp_state_ctx_t struct (which is the beginning of mp_state_thread_t).
This was the original assembler version of the NLR code was hard-coded to
have the nlr_top pointer at the start of this state structure.  But now
that the NLR code is partially written in C there is no longer this
restriction on the location of nlr_top (and a comment to this effect has
been removed in this patch).

So now the root pointer section starts part way through the
mp_state_thread_t structure, after the entries which are not root pointers.

This patch also moves the non-pointer entries for MICROPY_ENABLE_SCHEDULER
outside the root pointer section.

Moving non-pointer entries out of the root pointer section helps to make
the GC more precise and should help to prevent some cases of collectable
garbage being kept.

This patch also has a measurable improvement in performance of the
pystone.py benchmark: on unix x86-64 and stm32 there was an improvement of
roughly 0.6% (tested with both gcc 7.3 and gcc 8.1).
</content>
</entry>
<entry>
<title>py/gc: Update comment now that gc_drain_stack is called gc_mark_subtree.</title>
<updated>2018-02-19T05:08:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-02-19T05:08:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2a0cbc0d38e8e342c9a54c66a0cca10cae371c6a'/>
<id>urn:sha1:2a0cbc0d38e8e342c9a54c66a0cca10cae371c6a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/gc: Make GC stack pointer a local variable.</title>
<updated>2018-02-19T05:05:46+00:00</updated>
<author>
<name>Ayke van Laethem</name>
<email>aykevanlaethem@gmail.com</email>
</author>
<published>2018-02-15T16:22:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=736faef2233fe9c721b940a108b28808d4c7f7a0'/>
<id>urn:sha1:736faef2233fe9c721b940a108b28808d4c7f7a0</id>
<content type='text'>
This saves a bit in code size, and saves some precious .bss RAM:

                 .text  .bss
minimal CROSS=1: -28    -4
unix (64-bit):   -64    -8
</content>
</entry>
<entry>
<title>py/gc: Rename gc_drain_stack to gc_mark_subtree and pass it first block.</title>
<updated>2018-02-19T05:00:59+00:00</updated>
<author>
<name>Ayke van Laethem</name>
<email>aykevanlaethem@gmail.com</email>
</author>
<published>2018-02-15T16:10:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5c9e5618e088ddc233cd3bd1b1f48572ab403983'/>
<id>urn:sha1:5c9e5618e088ddc233cd3bd1b1f48572ab403983</id>
<content type='text'>
This saves a bit in code size:

minimal CROSS=1: -44
unix:            -96
</content>
</entry>
</feed>
