summaryrefslogtreecommitdiffstats
path: root/Objects/odictobject.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/odictobject.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/odictobject.c')
-rw-r--r--Objects/odictobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index b4ac560..83b326b 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -567,14 +567,14 @@ _odict_resize(PyODictObject *od)
i = _odict_get_index_raw(od, _odictnode_KEY(node),
_odictnode_HASH(node));
if (i < 0) {
- PyMem_FREE(fast_nodes);
+ PyMem_Free(fast_nodes);
return -1;
}
fast_nodes[i] = node;
}
/* Replace the old fast nodes table. */
- PyMem_FREE(od->od_fast_nodes);
+ PyMem_Free(od->od_fast_nodes);
od->od_fast_nodes = fast_nodes;
od->od_fast_nodes_size = size;
od->od_resize_sentinel = ((PyDictObject *)od)->ma_keys;
@@ -683,7 +683,7 @@ _odict_add_new_node(PyODictObject *od, PyObject *key, Py_hash_t hash)
}
/* must not be added yet */
- node = (_ODictNode *)PyMem_MALLOC(sizeof(_ODictNode));
+ node = (_ODictNode *)PyMem_Malloc(sizeof(_ODictNode));
if (node == NULL) {
Py_DECREF(key);
PyErr_NoMemory();
@@ -701,7 +701,7 @@ _odict_add_new_node(PyODictObject *od, PyObject *key, Py_hash_t hash)
#define _odictnode_DEALLOC(node) \
do { \
Py_DECREF(_odictnode_KEY(node)); \
- PyMem_FREE((void *)node); \
+ PyMem_Free((void *)node); \
} while (0)
/* Repeated calls on the same node are no-ops. */
@@ -776,7 +776,7 @@ _odict_clear_nodes(PyODictObject *od)
{
_ODictNode *node, *next;
- PyMem_FREE(od->od_fast_nodes);
+ PyMem_Free(od->od_fast_nodes);
od->od_fast_nodes = NULL;
od->od_fast_nodes_size = 0;
od->od_resize_sentinel = NULL;