8000 lib/utils: Change default value of pyexec_mode_kind to 0 to put in bss. · boris93/micropython@b51a2c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b51a2c2

Browse files
odewdneydpgeorge
authored andcommitted
lib/utils: Change default value of pyexec_mode_kind to 0 to put in bss.
By simply reordering the enums for pyexec_mode_kind_t it eliminates a data variable which costs ROM to initialise it. And the minimal build now has nothing in the data section. It seems the compiler is smart enough so that the generated code for if-logic which tests these enum values is unchanged.
1 parent 0645478 commit b51a2c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils/pyexec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include "py/obj.h"
3030

3131
typedef enum {
32-
PYEXEC_MODE_RAW_REPL,
3332
PYEXEC_MODE_FRIENDLY_REPL,
33+
PYEXEC_MODE_RAW_REPL,
3434
} pyexec_mode_kind_t;
3535

3636
extern pyexec_mode_kind_t pyexec_mode_kind;

0 commit comments

Comments
 (0)
0