py/gc: Avoid valgrind false positives.
When you want to use the valgrind memory analysis tool on MicroPython, you
can arrange to define MICROPY_DEBUG_VALGRIND to enable use of special
valgrind macros. For now, this only fixes `gc_get_ptr` so that it never
emits the diagnostic "Conditional jump or move depends on uninitialised
value(s)".
Signed-off-by: Jeff Epler <jepler@gmail.com>
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 765a8f4..564580c 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -510,6 +510,11 @@
#define MICROPY_DEBUG_VM_STACK_OVERFLOW (0)
#endif
+// Whether to enable extra instrumentation for valgrind
+#ifndef MICROPY_DEBUG_VALGRIND
+#define MICROPY_DEBUG_VALGRIND (0)
+#endif
+
/*****************************************************************************/
/* Optimisations */