<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/gc_long_lived.c, branch 4.x</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=4.x</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=4.x'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-02-02T00:05:37+00:00</updated>
<entry>
<title>Never long live the main dictionary.</title>
<updated>2019-02-02T00:05:37+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-02-02T00:05:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5555a24479a2f40d52d008c991f191d3b9b566bf'/>
<id>urn:sha1:5555a24479a2f40d52d008c991f191d3b9b566bf</id>
<content type='text'>
It's contents change often and may be referenced elsewhere.

Fixes #1443
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'adafruit/3.x' into import_merge</title>
<updated>2018-07-25T18:49:18+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-07-25T18:49:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1ffb0a714f056eaffdebaa411c3fcadb79a2b6d1'/>
<id>urn:sha1:1ffb0a714f056eaffdebaa411c3fcadb79a2b6d1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Prevent repetitive recursive scanning of dicts when making them long-lived</title>
<updated>2018-07-19T19:19:21+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-07-19T19:19:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=be1d882a8b5d2878c9b4402ae641abf9a88cd682'/>
<id>urn:sha1:be1d882a8b5d2878c9b4402ae641abf9a88cd682</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>Don't assume the type of the prop-&gt;proxy objects</title>
<updated>2018-03-25T20:11:30+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@unpythonic.net</email>
</author>
<published>2018-03-25T19:25:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=922b7c313197a28aa8243710d2d26f1034575674'/>
<id>urn:sha1:922b7c313197a28aa8243710d2d26f1034575674</id>
<content type='text'>
This fixes a crash running the cpydiff/core_class_superproperty.py
test, but it does not fix the difference to cpython3.

Closes: #705
</content>
</entry>
<entry>
<title>Fix the initial state and polish a couple comments.</title>
<updated>2018-01-24T22:13:26+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott.shawcroft@gmail.com</email>
</author>
<published>2018-01-24T22:13:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=aa0ce98b3e7228a469fa11709fbd6864242079b4'/>
<id>urn:sha1:aa0ce98b3e7228a469fa11709fbd6864242079b4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Introduce a long lived section of the heap.</title>
<updated>2018-01-24T18:33:46+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott.shawcroft@gmail.com</email>
</author>
<published>2018-01-24T00:22:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=416abe33ed44e44d8f75342731080217e123278b'/>
<id>urn:sha1:416abe33ed44e44d8f75342731080217e123278b</id>
<content type='text'>
This adapts the allocation process to start from either end of the heap
when searching for free space. The default behavior is identical to the
existing behavior where it starts with the lowest block and looks higher.
Now it can also look from the highest block and lower depending on the
long_lived parameter to gc_alloc. As the heap fills, the two sections may
overlap. When they overlap, a collect may be triggered in order to keep
the long lived section compact. However, free space is always eligable
for each type of allocation.

By starting from either of the end of the heap we have ability to separate
short lived objects from long lived ones. This separation reduces heap
fragmentation because long lived objects are easy to densely pack.

Most objects are short lived initially but may be made long lived when
they are referenced by a type or module. This involves copying the
memory and then letting the collect phase free the old portion.

QSTR pools and chunks are always long lived because they are never freed.

The reallocation, collection and free processes are largely unchanged. They
simply also maintain an index to the highest free block as well as the lowest.
These indices are used to speed up the allocation search until the next collect.

In practice, this change may slightly slow down import statements with the
benefit that memory is much less fragmented afterwards. For example, a test
import into a 20k heap that leaves ~6k free previously had the largest
continuous free space of ~400 bytes. After this change, the largest continuous
free space is over 3400 bytes.
</content>
</entry>
</feed>
