]> granicus.if.org Git - python/commitdiff
bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)
authorVictor Stinner <vstinner@python.org>
Thu, 10 Oct 2019 07:32:13 +0000 (09:32 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Oct 2019 07:32:13 +0000 (09:32 +0200)
bpo-38392, bpo-38426: Fix a compiler warning in gcmodule.c.

Fix also a typo in PYMEM_DEADBYTE macro comment.

Include/internal/pycore_pymem.h
Modules/gcmodule.c

index d61ff6ee4b77d6e5c54a5f0faccf2425461bebc4..535f99e8cc52efa88772e76c4122593c65a0168c 100644 (file)
@@ -162,7 +162,7 @@ PyAPI_FUNC(int) _PyMem_SetDefaultAllocator(
    - PYMEM_DEADBYTE dead (newly freed) memory
    - PYMEM_FORBIDDENBYTE: untouchable bytes at each end of a block
 
-   Byte patterns 0xCB, 0xBB and 0xFB have been replaced with 0xCD, 0xDD and
+   Byte patterns 0xCB, 0xDB and 0xFB have been replaced with 0xCD, 0xDD and
    0xFD to use the same values than Windows CRT debug malloc() and free().
    If modified, _PyMem_IsPtrFreed() should be updated as well. */
 #define PYMEM_CLEANBYTE      0xCD
index 766f8e0c67fa8ea2fff0a6afc92ce4a277cca3c3..b1e802e33e4985d2ae360f3b91d72b329da54ce0 100644 (file)
@@ -1921,6 +1921,8 @@ _PyGC_Dump(PyGC_Head *g)
     _PyObject_Dump(FROM_GC(g));
 }
 
+
+#ifdef Py_DEBUG
 static int
 visit_validate(PyObject *op, void *parent_raw)
 {
@@ -1931,6 +1933,7 @@ visit_validate(PyObject *op, void *parent_raw)
     }
     return 0;
 }
+#endif
 
 
 /* extension modules might be compiled with GC support so these