Skip to content

Commit 1684fea

Browse files
committed
feat(vendor): disable traceback allocation in PYOPT=1 builds
1 parent 49f4537 commit 1684fea

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

core/.changelog.d/5526.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't allocate tracebacks in optimized builds.

core/embed/projects/firmware/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
#define MICROPY_PY_USOCKET (0)
162162
#define MICROPY_PY_NETWORK (0)
163163

164+
// allocate traceback data only on debug builds
165+
#define MICROPY_PY_SYS_TRACEBACK_DISABLE (PYOPT)
166+
164167
#define MICROPY_PY_TREZORCONFIG (1)
165168
#define MICROPY_PY_TREZORCRYPTO (1)
166169
#define MICROPY_PY_TREZORIO (1)

core/embed/projects/unix/mpconfigport.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@
175175
#define MICROPY_PY_USOCKET (0)
176176
#define MICROPY_PY_NETWORK (0)
177177

178+
// allocate traceback data only on debug builds
179+
#define MICROPY_PY_SYS_TRACEBACK_DISABLE (PYOPT)
180+
178181
// Debugging and interactive functionality.
179182
#define MICROPY_DEBUG_PRINTERS (1)
180183
// Printing debug to stderr may give tests which

vendor/micropython

0 commit comments

Comments
 (0)