summaryrefslogtreecommitdiffstats
path: root/Include/pymem.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-12-01 09:37:39 (GMT)
committerGitHub <noreply@github.com>2020-12-01 09:37:39 (GMT)
commit32bd68c839adb7b42af12366ab0892303115d1d1 (patch)
tree205358a43a500fedb97ad0e370fbc998b42b3ae7 /Include/pymem.h
parent00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0 (diff)
downloadcpython-32bd68c839adb7b42af12366ab0892303115d1d1.zip
cpython-32bd68c839adb7b42af12366ab0892303115d1d1.tar.gz
cpython-32bd68c839adb7b42af12366ab0892303115d1d1.tar.bz2
bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587)
No longer use deprecated aliases to functions: * Replace PyObject_MALLOC() with PyObject_Malloc() * Replace PyObject_REALLOC() with PyObject_Realloc() * Replace PyObject_FREE() with PyObject_Free() * Replace PyObject_Del() with PyObject_Free() * Replace PyObject_DEL() with PyObject_Free()
Diffstat (limited to 'Include/pymem.h')
-rw-r--r--Include/pymem.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Include/pymem.h b/Include/pymem.h
index 5b9dd42..92cd536 100644
--- a/Include/pymem.h
+++ b/Include/pymem.h
@@ -79,13 +79,15 @@ PyAPI_FUNC(void) PyMem_Free(void *ptr);
// Deprecated aliases only kept for backward compatibility.
+// PyMem_Del and PyMem_DEL are defined with no parameter to be able to use
+// them as function pointers (ex: dealloc = PyMem_Del).
#define PyMem_MALLOC(n) PyMem_Malloc(n)
#define PyMem_NEW(type, n) PyMem_New(type, n)
#define PyMem_REALLOC(p, n) PyMem_Realloc(p, n)
#define PyMem_RESIZE(p, type, n) PyMem_Resize(p, type, n)
#define PyMem_FREE(p) PyMem_Free(p)
-#define PyMem_Del(p) PyMem_Free(p)
-#define PyMem_DEL(p) PyMem_Free(p)
+#define PyMem_Del PyMem_Free
+#define PyMem_DEL PyMem_Free
#ifndef Py_LIMITED_API