Skip to content

Commit 510492e

Browse files
committed
Remove PyMalloc_New, _PyMalloc_MALLOC, and PyMalloc_Del.
1 parent 9acae5a commit 510492e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Objects/stringobject.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PyString_FromStringAndSize(const char *str, int size)
6464

6565
/* PyObject_NewVar is inlined */
6666
op = (PyStringObject *)
67-
_PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
67+
PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
6868
if (op == NULL)
6969
return PyErr_NoMemory();
7070
PyObject_INIT_VAR(op, &PyString_Type, size);
@@ -120,7 +120,7 @@ PyString_FromString(const char *str)
120120

121121
/* PyObject_NewVar is inlined */
122122
op = (PyStringObject *)
123-
_PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
123+
PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
124124
if (op == NULL)
125125
return PyErr_NoMemory();
126126
PyObject_INIT_VAR(op, &PyString_Type, size);
@@ -717,7 +717,7 @@ string_concat(register PyStringObject *a, register PyObject *bb)
717717
size = a->ob_size + b->ob_size;
718718
/* PyObject_NewVar is inlined */
719719
op = (PyStringObject *)
720-
_PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
720+
PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
721721
if (op == NULL)
722722
return PyErr_NoMemory();
723723
PyObject_INIT_VAR(op, &PyString_Type, size);
@@ -760,7 +760,7 @@ string_repeat(register PyStringObject *a, register int n)
760760
return NULL;
761761
}
762762
op = (PyStringObject *)
763-
_PyMalloc_MALLOC(sizeof(PyStringObject) + nbytes);
763+
PyObject_MALLOC(sizeof(PyStringObject) + nbytes);
764764
if (op == NULL)
765765
return PyErr_NoMemory();
766766
PyObject_INIT_VAR(op, &PyString_Type, size);
@@ -2755,7 +2755,7 @@ PyTypeObject PyString_Type = {
27552755
0, /* tp_init */
27562756
0, /* tp_alloc */
27572757
string_new, /* tp_new */
2758-
_PyMalloc_Del, /* tp_free */
2758+
PyObject_Del, /* tp_free */
27592759
};
27602760

27612761
void
@@ -2807,10 +2807,10 @@ _PyString_Resize(PyObject **pv, int newsize)
28072807
#endif
28082808
_Py_ForgetReference(v);
28092809
*pv = (PyObject *)
2810-
_PyMalloc_REALLOC((char *)v,
2810+
PyObject_REALLOC((char *)v,
28112811
sizeof(PyStringObject) + newsize * sizeof(char));
28122812
if (*pv == NULL) {
2813-
PyMalloc_Del(v);
2813+
PyObject_Del(v);
28142814
PyErr_NoMemory();
28152815
return -1;
28162816
}

0 commit comments

Comments
 (0)