summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-02 21:55:42 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-13 12:49:18 +0000
commitd8c834c95d506db979ec871417de90b7951edc30 (patch)
tree929cb08dde61d960d18f47bd80f56114ff10bb4f /py/mpconfig.h
parentc8e9c0d89afa90694790fd48e1bf527487a5beb7 (diff)
downloadmicropython-d8c834c95d506db979ec871417de90b7951edc30.tar.gz
micropython-d8c834c95d506db979ec871417de90b7951edc30.zip
py: Add MICROPY_PERSISTENT_CODE_LOAD/SAVE to load/save bytecode.
MICROPY_PERSISTENT_CODE must be enabled, and then enabling MICROPY_PERSISTENT_CODE_LOAD/SAVE (either or both) will allow loading and/or saving of code (at the moment just bytecode) from/to a .mpy file.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 8019771e51..d3a57dda4a 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -192,9 +192,20 @@
/*****************************************************************************/
/* Micro Python emitters */
+// Whether to support loading of persistent code
+#ifndef MICROPY_PERSISTENT_CODE_LOAD
+#define MICROPY_PERSISTENT_CODE_LOAD (0)
+#endif
+
+// Whether to support saving of persistent code
+#ifndef MICROPY_PERSISTENT_CODE_SAVE
+#define MICROPY_PERSISTENT_CODE_SAVE (0)
+#endif
+
// 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 (0)
+#define MICROPY_PERSISTENT_CODE (MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE)
#endif
// Whether to emit x64 native code