diff options
author | Damien George <damien.p.george@gmail.com> | 2020-05-02 17:49:15 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-05-08 23:20:45 +1000 |
commit | f792e6c283e90067919e083c5ce6db156c0cd0e2 (patch) | |
tree | d02b70b2fa800e621ec62c9fa818b28d0564c7bd /py/runtime.h | |
parent | 0f83ef395cccaa771543450ff8a4200da108e3d6 (diff) |
py/scheduler: Convert mp_sched_full and mp_sched_num_pending to macros.
So they are guaranteed to be inlined within functions like
mp_sched_schedule which may be located in a special memory region.
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/py/runtime.h b/py/runtime.h index 53aed4429..0bf988b90 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -71,9 +71,7 @@ void mp_handle_pending_tail(mp_uint_t atomic_state); #if MICROPY_ENABLE_SCHEDULER void mp_sched_lock(void); void mp_sched_unlock(void); -static inline unsigned int mp_sched_num_pending(void) { - return MP_STATE_VM(sched_len); -} +#define mp_sched_num_pending() (MP_STATE_VM(sched_len)) bool mp_sched_schedule(mp_obj_t function, mp_obj_t arg); #endif |