Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58aa861

Browse files
committed
Remove PyMalloc_*.
1 parent 09a2ae5 commit 58aa861

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Objects/unicodeobject.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ PyUnicodeObject *_PyUnicode_New(int length)
201201
PyObject_INIT(unicode, &PyUnicode_Type);
202202
}
203203
else {
204-
unicode = PyMalloc_New(PyUnicodeObject, &PyUnicode_Type);
204+
unicode = PyObject_New(PyUnicodeObject, &PyUnicode_Type);
205205
if (unicode == NULL)
206206
return NULL;
207207
unicode->str = PyMem_NEW(Py_UNICODE, length + 1);
@@ -219,7 +219,7 @@ PyUnicodeObject *_PyUnicode_New(int length)
219219

220220
onError:
221221
_Py_ForgetReference((PyObject *)unicode);
222-
PyMalloc_Del(unicode);
222+
PyObject_Del(unicode);
223223
return NULL;
224224
}
225225

@@ -5718,7 +5718,7 @@ unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
57185718
pnew->str = PyMem_NEW(Py_UNICODE, n+1);
57195719
if (pnew->str == NULL) {
57205720
_Py_ForgetReference((PyObject *)pnew);
5721-
PyMalloc_Del(pnew);
5721+
PyObject_Del(pnew);
57225722
return NULL;
57235723
}
57245724
Py_UNICODE_COPY(pnew->str, tmp->str, n+1);
@@ -5776,7 +5776,7 @@ PyTypeObject PyUnicode_Type = {
57765776
0, /* tp_init */
57775777
0, /* tp_alloc */
57785778
unicode_new, /* tp_new */
5779-
_PyMalloc_Del, /* tp_free */
5779+
PyObject_Del, /* tp_free */
57805780
};
57815781

57825782
/* Initialize the Unicode implementation */
@@ -5818,7 +5818,7 @@ _PyUnicode_Fini(void)
58185818
if (v->str)
58195819
PyMem_DEL(v->str);
58205820
Py_XDECREF(v->defenc);
5821-
PyMalloc_Del(v);
5821+
PyObject_Del(v);
58225822
}
58235823
unicode_freelist = NULL;
58245824
unicode_freelist_size = 0;

0 commit comments

Comments
 (0)