<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/malloc.c, branch cross</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=cross</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=cross'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-02-23T13:53:38+00:00</updated>
<entry>
<title>py/malloc: Provide a proper malloc-based implementation of realloc_ext.</title>
<updated>2016-02-23T13:53:38+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-02-23T13:53:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e9d1a94bf099d585d0f8d3b0dddb8e0a397afcff'/>
<id>urn:sha1:e9d1a94bf099d585d0f8d3b0dddb8e0a397afcff</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Improve allocation policy of qstr data.</title>
<updated>2015-07-14T21:56:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-13T20:53:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ade9a052365247be5ed4ce8b53c2164a576a4a05'/>
<id>urn:sha1:ade9a052365247be5ed4ce8b53c2164a576a4a05</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>py: Add MICROPY_MALLOC_USES_ALLOCATED_SIZE to allow simpler malloc API.</title>
<updated>2015-03-03T21:23:13+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-27T09:54:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d891452a73165966497f1c79b64276faaa664597'/>
<id>urn:sha1:d891452a73165966497f1c79b64276faaa664597</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Put all global state together in state structures.</title>
<updated>2015-01-07T20:33:00+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-01T23:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b4b10fd350852e321624d74983cca286091b55a1'/>
<id>urn:sha1:b4b10fd350852e321624d74983cca286091b55a1</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>py: Move to guarded includes, everywhere in py/ core.</title>
<updated>2015-01-01T20:32:09+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-01T20:27:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=51dfcb4bb7613ed164952712d9a5235a7b833cde'/>
<id>urn:sha1:51dfcb4bb7613ed164952712d9a5235a7b833cde</id>
<content type='text'>
Addresses issue #1022.
</content>
</entry>
<entry>
<title>py: Make gc.enable/disable just control auto-GC; alloc is still allowed.</title>
<updated>2014-10-31T21:30:46+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-10-31T21:30:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=109c1de015eeee385020233e2f8cc6f921149103'/>
<id>urn:sha1:109c1de015eeee385020233e2f8cc6f921149103</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>py: Clean up edge cases of malloc/realloc/free.</title>
<updated>2014-10-23T11:02:00+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-10-23T11:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=37378f8a9d2b358fdde0f3451d816b7f506846cc'/>
<id>urn:sha1:37378f8a9d2b358fdde0f3451d816b7f506846cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: For malloc and vstr functions, use size_t exclusively for int type.</title>
<updated>2014-09-25T14:49:26+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-09-23T17:10:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b0261341d3706329ea58d8fc1a5ff9c788c9ccf7'/>
<id>urn:sha1:b0261341d3706329ea58d8fc1a5ff9c788c9ccf7</id>
<content type='text'>
It seems most sensible to use size_t for measuring "number of bytes" in
malloc and vstr functions (since that's what size_t is for).  We don't
use mp_uint_t because malloc and vstr are not Micro Python specific.
</content>
</entry>
<entry>
<title>py: Include mpconfig.h before all other includes.</title>
<updated>2014-06-21T19:43:22+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2014-06-21T19:43:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=59c675a64c1d9757d50ad4627da67a6f996a99fb'/>
<id>urn:sha1:59c675a64c1d9757d50ad4627da67a6f996a99fb</id>
<content type='text'>
It defines types used by all other headers.

Fixes #691.
</content>
</entry>
<entry>
<title>Add license header to (almost) all files.</title>
<updated>2014-05-03T22:27:38+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-05-03T22:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=04b9147e150d2d6fa3750f312fe328b6a71c1b28'/>
<id>urn:sha1:04b9147e150d2d6fa3750f312fe328b6a71c1b28</id>
<content type='text'>
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/.
</content>
</entry>
</feed>
