<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/parse.c, branch v1.8.6</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.6</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.6'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-11-02T12:15:41+00:00</updated>
<entry>
<title>py: Fix wrong assumption that m_renew will not move if shrinking</title>
<updated>2016-11-02T12:15:41+00:00</updated>
<author>
<name>Colin Hogben</name>
<email>colin@infinnovation.co.uk</email>
</author>
<published>2016-10-31T14:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f9b6b37cf65c4f65c4ad461d439fbf624c0f10c1'/>
<id>urn:sha1:f9b6b37cf65c4f65c4ad461d439fbf624c0f10c1</id>
<content type='text'>
In both parse.c and qstr.c, an internal chunking allocator tidies up
by calling m_renew to shrink an allocated chunk to the size used, and
assumes that the chunk will not move.  However, when MICROPY_ENABLE_GC
is false, m_renew calls the system realloc, which does not guarantee
this behaviour.  Environments where realloc may return a different
pointer include:

(1) mbed-os with MBED_HEAP_STATS_ENABLED (which adds a wrapper around
malloc &amp; friends; this is where I was hit by the bug);

(2) valgrind on linux (how I diagnosed it).

The fix is to call m_renew_maybe with allow_move=false.
</content>
</entry>
<entry>
<title>py/parse: Only replace constants that are standalone identifiers.</title>
<updated>2016-09-23T07:23:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-23T07:23:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6d310a5552f43b3f984a5d8020b41301ab7937a4'/>
<id>urn:sha1:6d310a5552f43b3f984a5d8020b41301ab7937a4</id>
<content type='text'>
This fixes constant substitution so that only standalone identifiers are
replaced with their constant value (if they have one).  I.e. don't
replace NAME in expressions like obj.NAME or NAME = expr.
</content>
</entry>
<entry>
<title>py/parse: Treat constants that start with underscore as private.</title>
<updated>2016-06-06T16:28:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-06-06T16:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b1533c43669c037d04c87d1756355cdc8edd5e0a'/>
<id>urn:sha1:b1533c43669c037d04c87d1756355cdc8edd5e0a</id>
<content type='text'>
Assignments of the form "_id = const(value)" are treated as private
(following a similar CPython convention) and code is no longer emitted
for the assignment to a global variable.

See issue #2111.
</content>
</entry>
<entry>
<title>py: Declare constant data as properly constant.</title>
<updated>2016-05-20T11:46:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-20T11:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3ff16ff52e45d4c0bf1df5fa650b72d6d835451b'/>
<id>urn:sha1:3ff16ff52e45d4c0bf1df5fa650b72d6d835451b</id>
<content type='text'>
Otherwise some compilers (eg without optimisation) will put this read-only
data in RAM instead of ROM.
</content>
</entry>
<entry>
<title>py/parse: Add uerrno to list of modules to look for constants in.</title>
<updated>2016-05-10T22:30:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-05-10T22:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e36ff98c80aa93a2f9fdd05800aaa6e75ead2b72'/>
<id>urn:sha1:e36ff98c80aa93a2f9fdd05800aaa6e75ead2b72</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Simplify "and" action within parser by making ident-rules explicit.</title>
<updated>2016-04-14T12:49:23+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-14T12:23:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0c1de1cdeea98e55710d27f7926da717086ac0fc'/>
<id>urn:sha1:0c1de1cdeea98e55710d27f7926da717086ac0fc</id>
<content type='text'>
Most grammar rules can optimise to the identity if they only have a single
argument, saving a lot of RAM building the parse tree.  Previous to this
patch, whether a given grammar rule could be optimised was defined (mostly
implicitly) by a complicated set of logic rules.  With this patch the
definition is always specified explicitly by using "and_ident" in the rule
definition in the grammar.  This simplifies the logic of the parser,
making it a bit smaller and faster.  RAM usage in unaffected.
</content>
</entry>
<entry>
<title>py: Fix constant folding and inline-asm to work with new async grammar.</title>
<updated>2016-04-13T14:26:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-13T14:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eacbd7aeba3bdd634b56af544e40da87779f4a95'/>
<id>urn:sha1:eacbd7aeba3bdd634b56af544e40da87779f4a95</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/parse: When looking up consts, check they exist before checking type.</title>
<updated>2016-03-19T21:36:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-03-19T21:36:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8d4d6731f56f9b1163f19d2455e8998aa0499afd'/>
<id>urn:sha1:8d4d6731f56f9b1163f19d2455e8998aa0499afd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/parse: Use m_renew_maybe to ensure that memory is shrunk in-place.</title>
<updated>2016-02-23T13:44:29+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-02-23T13:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d6c558c0aae53d3cd5f8871394f44bd23836307e'/>
<id>urn:sha1:d6c558c0aae53d3cd5f8871394f44bd23836307e</id>
<content type='text'>
The chunks of memory that the parser allocates contain parse nodes and
are pointed to from many places, so these chunks cannot be relocated
by the memory manager.  This patch makes it so that when a chunk is
shrunk to fit, it is not relocated.
</content>
</entry>
<entry>
<title>py: unary_op enum type fix, and a cast to remove clang warning</title>
<updated>2016-01-12T21:06:39+00:00</updated>
<author>
<name>Antonin ENFRUN</name>
<email>antonin.e@me.com</email>
</author>
<published>2016-01-12T21:06:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=efc971e8f9b69bbab32d5677239f2dfb16e8f3be'/>
<id>urn:sha1:efc971e8f9b69bbab32d5677239f2dfb16e8f3be</id>
<content type='text'>
</content>
</entry>
</feed>
