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()
This commit is contained in:
Victor Stinner 2020-12-01 10:37:39 +01:00 committed by GitHub
parent 00d7abd7ef
commit 32bd68c839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 102 additions and 98 deletions

View file

@ -198,7 +198,7 @@ PyBytes_FromString(const char *str)
}
/* Inline PyObject_NewVar */
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size);
op = (PyBytesObject *)PyObject_Malloc(PyBytesObject_SIZE + size);
if (op == NULL) {
return PyErr_NoMemory();
}
@ -1475,7 +1475,7 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n)
"repeated bytes are too long");
return NULL;
}
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes);
op = (PyBytesObject *)PyObject_Malloc(PyBytesObject_SIZE + nbytes);
if (op == NULL) {
return PyErr_NoMemory();
}
@ -3054,9 +3054,9 @@ _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize)
_Py_ForgetReference(v);
#endif
*pv = (PyObject *)
PyObject_REALLOC(v, PyBytesObject_SIZE + newsize);
PyObject_Realloc(v, PyBytesObject_SIZE + newsize);
if (*pv == NULL) {
PyObject_Del(v);
PyObject_Free(v);
PyErr_NoMemory();
return -1;
}