summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-01-31 22:24:16 +0000
committerDamien George <damien.p.george@gmail.com>2016-04-13 16:07:47 +0100
commit0a2e9650f5383bc1190d6b27a3d923e313c3d879 (patch)
treecf8cf4d9e9c69c1d07ef65cf926c47763df72ef3 /py/mpconfig.h
parent0699c6bf9e7a1754002948063390b68590fc3e96 (diff)
downloadmicropython-0a2e9650f5383bc1190d6b27a3d923e313c3d879.tar.gz
micropython-0a2e9650f5383bc1190d6b27a3d923e313c3d879.zip
py: Add ability to have frozen persistent bytecode from .mpy files.
The config variable MICROPY_MODULE_FROZEN is now made of two separate parts: MICROPY_MODULE_FROZEN_STR and MICROPY_MODULE_FROZEN_MPY. This allows to have none, either or both of frozen strings and frozen mpy files (aka frozen bytecode).
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 77ac614939..42ef19b72c 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -234,7 +234,7 @@
// Whether generated code can persist independently of the VM/runtime instance
// This is enabled automatically when needed by other features
#ifndef MICROPY_PERSISTENT_CODE
-#define MICROPY_PERSISTENT_CODE (MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE)
+#define MICROPY_PERSISTENT_CODE (MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE || MICROPY_MODULE_FROZEN_MPY)
#endif
// Whether to emit x64 native code
@@ -526,9 +526,19 @@ typedef double mp_float_t;
#define MICROPY_MODULE_WEAK_LINKS (0)
#endif
-// Whether frozen modules are supported
+// Whether frozen modules are supported in the form of strings
+#ifndef MICROPY_MODULE_FROZEN_STR
+#define MICROPY_MODULE_FROZEN_STR (0)
+#endif
+
+// Whether frozen modules are supported in the form of .mpy files
+#ifndef MICROPY_MODULE_FROZEN_MPY
+#define MICROPY_MODULE_FROZEN_MPY (0)
+#endif
+
+// Convenience macro for whether frozen modules are supported
#ifndef MICROPY_MODULE_FROZEN
-#define MICROPY_MODULE_FROZEN (0)
+#define MICROPY_MODULE_FROZEN (MICROPY_MODULE_FROZEN_STR || MICROPY_MODULE_FROZEN_MPY)
#endif
// Whether you can override builtins in the builtins module