summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-11-02 17:27:18 +0000
committerDamien George <damien.p.george@gmail.com>2015-11-13 12:49:18 +0000
commitc8e9c0d89afa90694790fd48e1bf527487a5beb7 (patch)
tree91ca77ecc152b0c2ffc682c705b05b97ef55cf31 /py/mpconfig.h
parent713ea1800d1f0c82a0c75885ad034705556ab5ef (diff)
downloadmicropython-c8e9c0d89afa90694790fd48e1bf527487a5beb7.tar.gz
micropython-c8e9c0d89afa90694790fd48e1bf527487a5beb7.zip
py: Add MICROPY_PERSISTENT_CODE so code can persist beyond the runtime.
Main changes when MICROPY_PERSISTENT_CODE is enabled are: - qstrs are encoded as 2-byte fixed width in the bytecode - all pointers are removed from bytecode and put in const_table (this includes const objects and raw code pointers) Ultimately this option will enable persistence for not just bytecode but also native code.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 4f023934e6..8019771e51 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -192,6 +192,11 @@
/*****************************************************************************/
/* Micro Python emitters */
+// Whether generated code can persist independently of the VM/runtime instance
+#ifndef MICROPY_PERSISTENT_CODE
+#define MICROPY_PERSISTENT_CODE (0)
+#endif
+
// Whether to emit x64 native code
#ifndef MICROPY_EMIT_X64
#define MICROPY_EMIT_X64 (0)