aboutsummaryrefslogtreecommitdiff
path: root/py/emit.h
diff options
context:
space:
mode:
authorDamien George2015-01-28 23:43:01 +0000
committerDamien George2015-01-28 23:43:01 +0000
commit0d3cb6726ddc1bab9fdd11a0aaa259fb436da4b2 (patch)
tree7285c3f452efdfce8c0ecb302bbd0e2efcca0c15 /py/emit.h
parent57aebe171459fd599f8d430c1ea1660ed307360c (diff)
py: Change vstr so that it doesn't null terminate buffer by default.
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.
Diffstat (limited to 'py/emit.h')
-rw-r--r--py/emit.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/emit.h b/py/emit.h
index 2ca3d0420..772ee0473 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -157,7 +157,7 @@ typedef struct _emit_method_table_t {
#if MICROPY_EMIT_CPYTHON
// these methods are only needed for emitcpy
- void (*load_const_verbatim_str)(emit_t *emit, const char *str);
+ void (*load_const_verbatim_strn)(emit_t *emit, const char *str, mp_uint_t len);
void (*load_closure)(emit_t *emit, qstr qst, mp_uint_t local_num);
void (*setup_loop)(emit_t *emit, mp_uint_t label);
#endif