summaryrefslogtreecommitdiff
path: root/py/misc.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-14 16:46:34 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-14 16:46:34 +1100
commit824f5c5a32d740acad50d23b7ab1d69660dcf3ad (patch)
treec2d1f13b656b7a2f218fa59e20fd2ca039d03721 /py/misc.h
parented878275b020c006ec197bb5f5bdd8179fb36a4c (diff)
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).
Diffstat (limited to 'py/misc.h')
-rw-r--r--py/misc.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/py/misc.h b/py/misc.h
index 3ed227a35..e60665e59 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -151,8 +151,7 @@ void vstr_init_fixed_buf(vstr_t *vstr, size_t alloc, char *buf);
struct _mp_print_t;
void vstr_init_print(vstr_t *vstr, size_t alloc, struct _mp_print_t *print);
void vstr_clear(vstr_t *vstr);
-vstr_t *vstr_new(void);
-vstr_t *vstr_new_size(size_t alloc);
+vstr_t *vstr_new(size_t alloc);
void vstr_free(vstr_t *vstr);
static inline void vstr_reset(vstr_t *vstr) { vstr->len = 0; }
static inline char *vstr_str(vstr_t *vstr) { return vstr->buf; }