mirror of
https://github.com/micropython/micropython.git
synced 2025-08-17 16:10:33 +02:00
py: Introduce and use mp_raise_type_arg helper.
To reduce code size. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -43,8 +43,7 @@ void *mp_pystack_alloc(size_t n_bytes) {
|
||||
#endif
|
||||
if (MP_STATE_THREAD(pystack_cur) + n_bytes > MP_STATE_THREAD(pystack_end)) {
|
||||
// out of memory in the pystack
|
||||
nlr_raise(mp_obj_new_exception_arg1(&mp_type_RuntimeError,
|
||||
MP_OBJ_NEW_QSTR(MP_QSTR_pystack_space_exhausted)));
|
||||
mp_raise_type_arg(&mp_type_RuntimeError, MP_OBJ_NEW_QSTR(MP_QSTR_pystack_space_exhausted));
|
||||
}
|
||||
void *ptr = MP_STATE_THREAD(pystack_cur);
|
||||
MP_STATE_THREAD(pystack_cur) += n_bytes;
|
||||
|
Reference in New Issue
Block a user