summaryrefslogtreecommitdiff
path: root/py/runtime.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-08-12 21:26:12 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-08-12 21:28:45 +0300
commit9e1b61dedd82dffccbe4f20996eadaf79726d427 (patch)
tree6160a03cedf8d71c91968ccc801b9911e9feb5ea /py/runtime.h
parentaf9889f99a325adb725c61476bd580b11593ca50 (diff)
py/runtime: Factor out exception raising helpers.
Introduce mp_raise_msg(), mp_raise_ValueError(), mp_raise_TypeError() instead of previous pattern nlr_raise(mp_obj_new_exception_msg(...)). Save few bytes on each call, which are many.
Diffstat (limited to 'py/runtime.h')
-rw-r--r--py/runtime.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h
index 3e325a31b..df5e45b2d 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -134,6 +134,10 @@ mp_obj_t mp_import_from(mp_obj_t module, qstr name);
void mp_import_all(mp_obj_t module);
// Raise NotImplementedError with given message
+NORETURN void mp_raise_msg(const mp_obj_type_t *exc_type, const char *msg);
+//NORETURN void nlr_raise_msg_varg(const mp_obj_type_t *exc_type, const char *fmt, ...);
+NORETURN void mp_raise_ValueError(const char *msg);
+NORETURN void mp_raise_TypeError(const char *msg);
NORETURN void mp_not_implemented(const char *msg);
NORETURN void mp_exc_recursion_depth(void);