<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/parse.h, branch v1.8.4</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.4</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.4'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-01-07T14:40:35+00:00</updated>
<entry>
<title>py/parse: Improve constant folding to operate on small and big ints.</title>
<updated>2016-01-07T14:40:35+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-07T14:40:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=22b2265053ef9fec4b1aedab770b32f71b0c85f7'/>
<id>urn:sha1:22b2265053ef9fec4b1aedab770b32f71b0c85f7</id>
<content type='text'>
Constant folding in the parser can now operate on big ints, whatever
their representation.  This is now possible because the parser can create
parse nodes holding arbitrary objects.  For the case of small ints the
folding is still efficient in RAM because the folded small int is stored
inplace in the parse node.

Adds 48 bytes to code size on Thumb2 architecture.  Helps reduce heap
usage because more constants can be computed at compile time, leading to
a smaller parse tree, and most importantly means that the constants don't
have to be computed at runtime (perhaps more than once).  Parser will now
be a little slower when folding due to calls to runtime to do the
arithmetic.
</content>
</entry>
<entry>
<title>py/parse: Include stddef.h for definition of size_t.</title>
<updated>2015-12-17T22:17:26+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-17T22:17:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2fe7e6bef0b41129c1e443660edd7ad29b74daaa'/>
<id>urn:sha1:2fe7e6bef0b41129c1e443660edd7ad29b74daaa</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/parse: Replace mp_int_t/mp_uint_t with size_t etc, where appropriate.</title>
<updated>2015-12-17T13:06:05+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-17T13:06:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=16a6a47a7bda60704a34290bc77768bfde0d41ce'/>
<id>urn:sha1:16a6a47a7bda60704a34290bc77768bfde0d41ce</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.</title>
<updated>2015-11-29T14:25:35+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-27T17:01:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=999cedb90ff0827cdb9dfe0e4faa6ebc1739d271'/>
<id>urn:sha1:999cedb90ff0827cdb9dfe0e4faa6ebc1739d271</id>
<content type='text'>
This allows the mp_obj_t type to be configured to something other than a
pointer-sized primitive type.

This patch also includes additional changes to allow the code to compile
when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
mp_uint_t, and various casts.
</content>
</entry>
<entry>
<title>py: Allocate parse nodes in chunks to reduce fragmentation and RAM use.</title>
<updated>2015-10-01T23:11:11+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-09-23T09:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329'/>
<id>urn:sha1:58e0f4ac50b3dc732cbfe0d7b04bb41951ac1329</id>
<content type='text'>
With this patch parse nodes are allocated sequentially in chunks.  This
reduces fragmentation of the heap and prevents waste at the end of
individually allocated parse nodes.

Saves roughly 20% of RAM during parse stage.
</content>
</entry>
<entry>
<title>py: Expose compile.c:list_get as mp_parse_node_extract_list.</title>
<updated>2015-02-13T02:29:46+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-13T02:29:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dfe944c3e5c2a7fa04c3416266728ffce6332bf8'/>
<id>urn:sha1:dfe944c3e5c2a7fa04c3416266728ffce6332bf8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Parse big-int/float/imag constants directly in parser.</title>
<updated>2015-02-08T01:57:40+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-08T01:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d414a1b52d193bab2c94cf56932e1eba23ba542'/>
<id>urn:sha1:7d414a1b52d193bab2c94cf56932e1eba23ba542</id>
<content type='text'>
Previous to this patch, a big-int, float or imag constant was interned
(made into a qstr) and then parsed at runtime to create an object each
time it was needed.  This is wasteful in RAM and not efficient.  Now,
these constants are parsed straight away in the parser and turned into
objects.  This allows constants with large numbers of digits (so
addresses issue #1103) and takes us a step closer to #722.
</content>
</entry>
<entry>
<title>py: Protect mp_parse and mp_compile with nlr push/pop block.</title>
<updated>2015-02-07T18:33:58+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-02-07T18:33:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0bfc7638baa4c5a4a2351364ab770a188dcab302'/>
<id>urn:sha1:0bfc7638baa4c5a4a2351364ab770a188dcab302</id>
<content type='text'>
To enable parsing constants more efficiently, mp_parse should be allowed
to raise an exception, and mp_compile can already raise a MemoryError.
So these functions need to be protected by an nlr push/pop block.

This patch adds that feature in all places.  This allows to simplify how
mp_parse and mp_compile are called: they now raise an exception if they
have an error and so explicit checking is not needed anymore.
</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: Move to guarded includes for compile.h and related headers.</title>
<updated>2014-12-27T14:12:17+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2014-12-25T21:29:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8ab6f9067412d9f73fe88d42d81c0b4c4f1fd20b'/>
<id>urn:sha1:8ab6f9067412d9f73fe88d42d81c0b4c4f1fd20b</id>
<content type='text'>
</content>
</entry>
</feed>
