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

@ -1059,7 +1059,7 @@ PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
obj = _PyObject_GC_Malloc(size);
}
else {
obj = (PyObject *)PyObject_MALLOC(size);
obj = (PyObject *)PyObject_Malloc(size);
}
if (obj == NULL) {
@ -2707,7 +2707,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
goto error;
/* Silently truncate the docstring if it contains null bytes. */
len = strlen(doc_str);
tp_doc = (char *)PyObject_MALLOC(len + 1);
tp_doc = (char *)PyObject_Malloc(len + 1);
if (tp_doc == NULL) {
PyErr_NoMemory();
goto error;
@ -3047,7 +3047,7 @@ PyType_FromModuleAndSpec(PyObject *module, PyType_Spec *spec, PyObject *bases)
continue;
}
size_t len = strlen(slot->pfunc)+1;
char *tp_doc = PyObject_MALLOC(len);
char *tp_doc = PyObject_Malloc(len);
if (tp_doc == NULL) {
type->tp_doc = NULL;
PyErr_NoMemory();