mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
Remove PyMalloc_New, _PyMalloc_MALLOC, and PyMalloc_Del.
This commit is contained in:
parent
9acae5a0a6
commit
510492e985
1 changed files with 7 additions and 7 deletions
|
@ -64,7 +64,7 @@ PyString_FromStringAndSize(const char *str, int size)
|
||||||
|
|
||||||
/* PyObject_NewVar is inlined */
|
/* PyObject_NewVar is inlined */
|
||||||
op = (PyStringObject *)
|
op = (PyStringObject *)
|
||||||
_PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
|
PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
PyObject_INIT_VAR(op, &PyString_Type, size);
|
PyObject_INIT_VAR(op, &PyString_Type, size);
|
||||||
|
@ -120,7 +120,7 @@ PyString_FromString(const char *str)
|
||||||
|
|
||||||
/* PyObject_NewVar is inlined */
|
/* PyObject_NewVar is inlined */
|
||||||
op = (PyStringObject *)
|
op = (PyStringObject *)
|
||||||
_PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
|
PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
PyObject_INIT_VAR(op, &PyString_Type, size);
|
PyObject_INIT_VAR(op, &PyString_Type, size);
|
||||||
|
@ -717,7 +717,7 @@ string_concat(register PyStringObject *a, register PyObject *bb)
|
||||||
size = a->ob_size + b->ob_size;
|
size = a->ob_size + b->ob_size;
|
||||||
/* PyObject_NewVar is inlined */
|
/* PyObject_NewVar is inlined */
|
||||||
op = (PyStringObject *)
|
op = (PyStringObject *)
|
||||||
_PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
|
PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char));
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
PyObject_INIT_VAR(op, &PyString_Type, size);
|
PyObject_INIT_VAR(op, &PyString_Type, size);
|
||||||
|
@ -760,7 +760,7 @@ string_repeat(register PyStringObject *a, register int n)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
op = (PyStringObject *)
|
op = (PyStringObject *)
|
||||||
_PyMalloc_MALLOC(sizeof(PyStringObject) + nbytes);
|
PyObject_MALLOC(sizeof(PyStringObject) + nbytes);
|
||||||
if (op == NULL)
|
if (op == NULL)
|
||||||
return PyErr_NoMemory();
|
return PyErr_NoMemory();
|
||||||
PyObject_INIT_VAR(op, &PyString_Type, size);
|
PyObject_INIT_VAR(op, &PyString_Type, size);
|
||||||
|
@ -2755,7 +2755,7 @@ PyTypeObject PyString_Type = {
|
||||||
0, /* tp_init */
|
0, /* tp_init */
|
||||||
0, /* tp_alloc */
|
0, /* tp_alloc */
|
||||||
string_new, /* tp_new */
|
string_new, /* tp_new */
|
||||||
_PyMalloc_Del, /* tp_free */
|
PyObject_Del, /* tp_free */
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2807,10 +2807,10 @@ _PyString_Resize(PyObject **pv, int newsize)
|
||||||
#endif
|
#endif
|
||||||
_Py_ForgetReference(v);
|
_Py_ForgetReference(v);
|
||||||
*pv = (PyObject *)
|
*pv = (PyObject *)
|
||||||
_PyMalloc_REALLOC((char *)v,
|
PyObject_REALLOC((char *)v,
|
||||||
sizeof(PyStringObject) + newsize * sizeof(char));
|
sizeof(PyStringObject) + newsize * sizeof(char));
|
||||||
if (*pv == NULL) {
|
if (*pv == NULL) {
|
||||||
PyMalloc_Del(v);
|
PyObject_Del(v);
|
||||||
PyErr_NoMemory();
|
PyErr_NoMemory();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue