Skip to content

Commit 2b82f51

Browse files
committed
unix/alloc: Map executable memory for code loading when needed.
This commit lets the Unix port use the new MICROPY_PERSISTENT_CODE_LOAD_NATIVE configuration entry. The Unix port needs to allocate memory with specific flags that let the operating system run executable code from there. This functionality was gated behind the presence of a native emitter and thus its inclusion condition had to be updated. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
1 parent 9e9da6c commit 2b82f51

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ports/unix/alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#include "py/mpstate.h"
3434

35-
#if MICROPY_EMIT_NATIVE
35+
#if MICROPY_ENABLE_NATIVE_CODE
3636

3737
#if defined(__OpenBSD__) || defined(__MACH__)
3838
#define MAP_ANONYMOUS MAP_ANON
@@ -80,4 +80,4 @@ void mp_unix_free_exec(void *ptr, size_t size) {
8080

8181
MP_REGISTER_ROOT_POINTER(void *mmap_region_head);
8282

83-
#endif // MICROPY_EMIT_NATIVE
83+
#endif // MICROPY_ENABLE_NATIVE_CODE

0 commit comments

Comments
 (0)