diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2023-08-23 13:30:20 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-08-30 10:58:04 +1000 |
| commit | b2b5bcce28016c16f9c25772195ebe89576c17de (patch) | |
| tree | af248fe3eae87af3c22482f8c1618998a8318371 /py/profile.c | |
| parent | 4a3fdc0e76c640d550099cecaa41f8c3e1489562 (diff) | |
py/profile: Remove the requirement to disable MICROPY_COMP_CONST.
The only reason that const had to be disabled was to make the test output
match CPython when const was involved. Instead, this commit fixes the test
to handle the lines where const is used.
Also:
- remove the special handling for MICROPY_PERSISTENT_CODE_SAVE in
unix/mpconfigport.h, and make this automatic.
- move the check for MICROPY_PERSISTENT_CODE_SAVE to where it's used (like
we do for other similar checks) and add a comment explaining it.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/profile.c')
| -rw-r--r-- | py/profile.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/profile.c b/py/profile.c index 89af8640a..274089d70 100644 --- a/py/profile.c +++ b/py/profile.c @@ -31,6 +31,12 @@ #if MICROPY_PY_SYS_SETTRACE +#if !MICROPY_PERSISTENT_CODE_SAVE +// The settrace feature requires that we maintain additional metadata on the raw +// code object which is normally only done when writing .mpy files. +#error "MICROPY_PY_SYS_SETTRACE requires MICROPY_PERSISTENT_CODE_SAVE to be enabled" +#endif + #define prof_trace_cb MP_STATE_THREAD(prof_trace_callback) #define QSTR_MAP(context, idx) (context->constants.qstr_table[idx]) |
