<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/stream.c, branch v1.4.5</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.5</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.4.5'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-05-12T22:05:53+00:00</updated>
<entry>
<title>py: Add mp_obj_get_int_truncated and use it where appropriate.</title>
<updated>2015-05-12T22:05:53+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-05-12T22:05:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c50772d19fe2804a6d0258f89dd9967d3b516fd3'/>
<id>urn:sha1:c50772d19fe2804a6d0258f89dd9967d3b516fd3</id>
<content type='text'>
mp_obj_get_int_truncated will raise a TypeError if the argument is not
an integral type.  Use mp_obj_int_get_truncated only when you know the
argument is a small or big int.
</content>
</entry>
<entry>
<title>py: Change vstr so that it doesn't null terminate buffer by default.</title>
<updated>2015-01-28T23:43:01+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-28T23:43:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0d3cb6726ddc1bab9fdd11a0aaa259fb436da4b2'/>
<id>urn:sha1:0d3cb6726ddc1bab9fdd11a0aaa259fb436da4b2</id>
<content type='text'>
This cleans up vstr so that it's a pure "variable buffer", and the user
can decide whether they need to add a terminating null byte.  In most
places where vstr is used, the vstr did not need to be null terminated
and so this patch saves code size, a tiny bit of RAM, and makes vstr
usage more efficient.  When null termination is needed it must be
done explicitly using vstr_null_terminate.
</content>
</entry>
<entry>
<title>stream: readall(): Make sure there's a trailing NUL char.</title>
<updated>2015-01-23T22:22:47+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-01-23T22:22:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ca3dbb8d8bd7fa5cc08af00af538ca62158763a1'/>
<id>urn:sha1:ca3dbb8d8bd7fa5cc08af00af538ca62158763a1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>stream: Fix readall() implementation in respect to NUL terminator bytes.</title>
<updated>2015-01-23T15:59:37+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-01-23T15:58:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=425f952a1e18e64f19a0330c9c54a3eccb3c4ff7'/>
<id>urn:sha1:425f952a1e18e64f19a0330c9c54a3eccb3c4ff7</id>
<content type='text'>
After vstr refactor. Fixes #1084.
</content>
</entry>
<entry>
<title>py: Remove mp_obj_str_builder and use vstr instead.</title>
<updated>2015-01-21T23:18:02+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-21T22:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=05005f679e00241e15a87751d89327f2c4630cb6'/>
<id>urn:sha1:05005f679e00241e15a87751d89327f2c4630cb6</id>
<content type='text'>
With this patch str/bytes construction is streamlined.  Always use a
vstr to build a str/bytes object.  If the size is known beforehand then
use vstr_init_len to allocate only required memory.  Otherwise use
vstr_init and the vstr will grow as needed.  Then use
mp_obj_new_str_from_vstr to create a str/bytes object using the vstr
memory.

Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes
on unix x64.
</content>
</entry>
<entry>
<title>py: Add mp_obj_new_str_from_vstr, and use it where relevant.</title>
<updated>2015-01-21T23:17:27+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-21T19:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0b9ee86133a2a0524691c6cdac209dbfcb3bf116'/>
<id>urn:sha1:0b9ee86133a2a0524691c6cdac209dbfcb3bf116</id>
<content type='text'>
This patch allows to reuse vstr memory when creating str/bytes object.
This improves memory usage.

Also saves code ROM: 128 bytes on stmhal, 92 bytes on bare-arm, and 88
bytes on unix x64.
</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: Rename mp_obj_int_get to mp_obj_int_get_truncated; fix struct.pack.</title>
<updated>2014-12-05T23:13:52+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-12-05T23:13:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=be6d8be91e133e98117025062df0e63aaf87efd2'/>
<id>urn:sha1:be6d8be91e133e98117025062df0e63aaf87efd2</id>
<content type='text'>
mp_obj_int_get_truncated is used as a "fast path" int accessor that
doesn't check for overflow and returns the int truncated to the machine
word size, ie mp_int_t.

Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word
sized values.

Addresses issues #779 and #998.
</content>
</entry>
<entry>
<title>py: Make stream seek correctly check for ioctl fn; add seek for textio.</title>
<updated>2014-11-16T23:56:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-11-16T23:56:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5694cc5490235a9091fe3e2c5563471565e3da97'/>
<id>urn:sha1:5694cc5490235a9091fe3e2c5563471565e3da97</id>
<content type='text'>
</content>
</entry>
<entry>
<title>stream: Implement seek operation support via ioctl, wrapped in generic method.</title>
<updated>2014-11-16T22:16:14+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2014-11-16T22:16:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=838eb1fa2d365ee085082b26e8b8b6ec657af572'/>
<id>urn:sha1:838eb1fa2d365ee085082b26e8b8b6ec657af572</id>
<content type='text'>
Also, implement for unix port.
</content>
</entry>
</feed>
