diff options
author | Victor Stinner <vstinner@python.org> | 2020-12-01 09:56:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 09:56:42 +0100 |
commit | 00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0 (patch) | |
tree | 26ebb0fe409768193bb85be90c0229a0f44d6f8e /Objects/codeobject.c | |
parent | bpo-31904: Fix fifo test cases for VxWorks (GH-20254) (diff) | |
download | cpython-00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0.tar.gz cpython-00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0.tar.bz2 cpython-00d7abd7ef588fc4ff0571c8579ab4aba8ada1c0.zip |
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/codeobject.c')
-rw-r--r-- | Objects/codeobject.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 7b224cc145e..0257295f1e9 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -213,7 +213,7 @@ PyCode_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, PyObject *arg = PyTuple_GET_ITEM(varnames, j); int cmp = PyUnicode_Compare(cell, arg); if (cmp == -1 && PyErr_Occurred()) { - PyMem_FREE(cell2arg); + PyMem_Free(cell2arg); return NULL; } if (cmp == 0) { @@ -224,14 +224,14 @@ PyCode_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, } } if (!used_cell2arg) { - PyMem_FREE(cell2arg); + PyMem_Free(cell2arg); cell2arg = NULL; } } co = PyObject_New(PyCodeObject, &PyCode_Type); if (co == NULL) { if (cell2arg) - PyMem_FREE(cell2arg); + PyMem_Free(cell2arg); return NULL; } co->co_argcount = argcount; @@ -314,12 +314,12 @@ _PyCode_InitOpcache(PyCodeObject *co) if (opts) { co->co_opcache = (_PyOpcache *)PyMem_Calloc(opts, sizeof(_PyOpcache)); if (co->co_opcache == NULL) { - PyMem_FREE(co->co_opcache_map); + PyMem_Free(co->co_opcache_map); return -1; } } else { - PyMem_FREE(co->co_opcache_map); + PyMem_Free(co->co_opcache_map); co->co_opcache_map = NULL; co->co_opcache = NULL; } @@ -631,10 +631,10 @@ static void code_dealloc(PyCodeObject *co) { if (co->co_opcache != NULL) { - PyMem_FREE(co->co_opcache); + PyMem_Free(co->co_opcache); } if (co->co_opcache_map != NULL) { - PyMem_FREE(co->co_opcache_map); + PyMem_Free(co->co_opcache_map); } co->co_opcache_flag = 0; co->co_opcache_size = 0; @@ -664,7 +664,7 @@ code_dealloc(PyCodeObject *co) Py_XDECREF(co->co_name); Py_XDECREF(co->co_linetable); if (co->co_cell2arg != NULL) - PyMem_FREE(co->co_cell2arg); + PyMem_Free(co->co_cell2arg); if (co->co_zombieframe != NULL) PyObject_GC_Del(co->co_zombieframe); if (co->co_weakreflist != NULL) |