mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
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:
parent
00d7abd7ef
commit
32bd68c839
48 changed files with 102 additions and 98 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue