py: Fix bug where GC collected native/viper/asm function data.
Because (for Thumb) a function pointer has the LSB set, pointers to
dynamic functions in RAM (eg native, viper or asm functions) were not
being traced by the GC. This patch is a comprehensive fix for this.
Addresses issue #820.
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 850d055..73c015a 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -429,6 +429,12 @@
#define MP_ENDIANNESS_LITTLE (0)
#endif
+// Make a pointer to RAM callable (eg set lower bit for Thumb code)
+// (This scheme won't work if we want to mix Thumb and normal ARM code.)
+#ifndef MICROPY_MAKE_POINTER_CALLABLE
+#define MICROPY_MAKE_POINTER_CALLABLE(p) (p)
+#endif
+
// printf format spec to use for mp_int_t and friends
#ifndef INT_FMT
#ifdef __LP64__