summaryrefslogtreecommitdiffstats
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-12-01 08:56:42 (GMT)
committerGitHub <noreply@github.com>2020-12-01 08:56:42 (GMT)
commit00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0 (patch)
tree26ebb0fe409768193bb85be90c0229a0f44d6f8e /Objects/moduleobject.c
parentb2d0c66e881301ed8908da3cb41bbf253c449b0c (diff)
downloadcpython-00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0.zip
cpython-00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0.tar.gz
cpython-00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0.tar.bz2
bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586)
No longer use deprecated aliases to functions: * Replace PyMem_MALLOC() with PyMem_Malloc() * Replace PyMem_REALLOC() with PyMem_Realloc() * Replace PyMem_FREE() with PyMem_Free() * Replace PyMem_Del() with PyMem_Free() * Replace PyMem_DEL() with PyMem_Free() Modify also the PyMem_DEL() macro to use directly PyMem_Free().
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index c3ceb78..6590387 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -211,7 +211,7 @@ _PyModule_CreateInitialized(struct PyModuleDef* module, int module_api_version)
return NULL;
if (module->m_size > 0) {
- m->md_state = PyMem_MALLOC(module->m_size);
+ m->md_state = PyMem_Malloc(module->m_size);
if (!m->md_state) {
PyErr_NoMemory();
Py_DECREF(m);
@@ -377,7 +377,7 @@ PyModule_ExecDef(PyObject *module, PyModuleDef *def)
if (md->md_state == NULL) {
/* Always set a state pointer; this serves as a marker to skip
* multiple initialization (importlib.reload() is no-op) */
- md->md_state = PyMem_MALLOC(def->m_size);
+ md->md_state = PyMem_Malloc(def->m_size);
if (!md->md_state) {
PyErr_NoMemory();
return -1;
@@ -681,7 +681,7 @@ module_dealloc(PyModuleObject *m)
Py_XDECREF(m->md_dict);
Py_XDECREF(m->md_name);
if (m->md_state != NULL)
- PyMem_FREE(m->md_state);
+ PyMem_Free(m->md_state);
Py_TYPE(m)->tp_free((PyObject *)m);
}