summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/bufhelper.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-21 22:48:37 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-21 23:18:02 +0000
commit05005f679e00241e15a87751d89327f2c4630cb6 (patch)
tree50319ab1dee5af8016e95e3c80a3b28346cdca21 /stmhal/bufhelper.h
parent0b9ee86133a2a0524691c6cdac209dbfcb3bf116 (diff)
downloadmicropython-05005f679e00241e15a87751d89327f2c4630cb6.tar.gz
micropython-05005f679e00241e15a87751d89327f2c4630cb6.zip
py: Remove mp_obj_str_builder and use vstr instead.
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.
Diffstat (limited to 'stmhal/bufhelper.h')
-rw-r--r--stmhal/bufhelper.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/stmhal/bufhelper.h b/stmhal/bufhelper.h
index febbe7e4fd..abdeea6a80 100644
--- a/stmhal/bufhelper.h
+++ b/stmhal/bufhelper.h
@@ -25,4 +25,4 @@
*/
void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data);
-mp_obj_t pyb_buf_get_for_recv(mp_obj_t o, mp_buffer_info_t *bufinfo);
+mp_obj_t pyb_buf_get_for_recv(mp_obj_t o, vstr_t *vstr);