Mercurial > cpython-lru_cache-weakref
diff Objects/stringobject.c @ 22446:d5aad6c581c9 legacy-trunk
Use pymalloc if it's enabled.
| author | Neil Schemenauer <nascheme@enme.ucalgary.ca> |
|---|---|
| date | Fri, 22 Mar 2002 15:33:15 +0000 |
| parents | 5b24a6ae2dc4 |
| children | f3a416b178c4 |
line wrap: on
line diff
--- a/Objects/stringobject.c Fri Mar 22 15:28:30 2002 +0000 +++ b/Objects/stringobject.c Fri Mar 22 15:33:15 2002 +0000 @@ -68,7 +68,7 @@ /* PyObject_NewVar is inlined */ op = (PyStringObject *) - PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char)); + _PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char)); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -131,7 +131,7 @@ /* PyObject_NewVar is inlined */ op = (PyStringObject *) - PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char)); + _PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char)); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -733,7 +733,7 @@ size = a->ob_size + b->ob_size; /* PyObject_NewVar is inlined */ op = (PyStringObject *) - PyObject_MALLOC(sizeof(PyStringObject) + size * sizeof(char)); + _PyMalloc_MALLOC(sizeof(PyStringObject) + size * sizeof(char)); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -780,7 +780,7 @@ return NULL; } op = (PyStringObject *) - PyObject_MALLOC(sizeof(PyStringObject) + nbytes); + _PyMalloc_MALLOC(sizeof(PyStringObject) + nbytes); if (op == NULL) return PyErr_NoMemory(); PyObject_INIT_VAR(op, &PyString_Type, size); @@ -2789,7 +2789,7 @@ 0, /* tp_init */ 0, /* tp_alloc */ string_new, /* tp_new */ - _PyObject_Del, /* tp_free */ + _PyMalloc_Del, /* tp_free */ }; void @@ -2841,10 +2841,10 @@ #endif _Py_ForgetReference(v); *pv = (PyObject *) - PyObject_REALLOC((char *)v, + _PyMalloc_REALLOC((char *)v, sizeof(PyStringObject) + newsize * sizeof(char)); if (*pv == NULL) { - PyObject_DEL(v); + PyMalloc_Del(v); PyErr_NoMemory(); return -1; }
