From 824f5c5a32d740acad50d23b7ab1d69660dcf3ad Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 14 Oct 2016 16:46:34 +1100 Subject: py/vstr: Combine vstr_new_size with vstr_new since they are rarely used. Now there is just one function to allocate a new vstr, namely vstr_new (in addition to vstr_init etc). The caller of this function should know what initial size to allocate for the buffer, or at least have some policy or config option, instead of leaving it to a default (as it was before). --- py/objstringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objstringio.c') diff --git a/py/objstringio.c b/py/objstringio.c index be1a7d89c..212d8e314 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -150,7 +150,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stringio___exit___obj, 4, 4, stringio STATIC mp_obj_stringio_t *stringio_new(const mp_obj_type_t *type) { mp_obj_stringio_t *o = m_new_obj(mp_obj_stringio_t); o->base.type = type; - o->vstr = vstr_new(); + o->vstr = vstr_new(16); o->pos = 0; return o; } -- cgit v1.2.3