mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Some more changes to make code compile under a C++ compiler.
This commit is contained in:
parent
7b782b61c5
commit
64182fe0b3
5 changed files with 11 additions and 10 deletions
|
|
@ -1281,7 +1281,8 @@ PyObject *
|
|||
_PyObject_GC_Malloc(size_t basicsize)
|
||||
{
|
||||
PyObject *op;
|
||||
PyGC_Head *g = PyObject_MALLOC(sizeof(PyGC_Head) + basicsize);
|
||||
PyGC_Head *g = (PyGC_Head *)PyObject_MALLOC(
|
||||
sizeof(PyGC_Head) + basicsize);
|
||||
if (g == NULL)
|
||||
return PyErr_NoMemory();
|
||||
g->gc.gc_refs = GC_UNTRACKED;
|
||||
|
|
@ -1323,7 +1324,7 @@ _PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems)
|
|||
{
|
||||
const size_t basicsize = _PyObject_VAR_SIZE(op->ob_type, nitems);
|
||||
PyGC_Head *g = AS_GC(op);
|
||||
g = PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);
|
||||
g = (PyGC_Head *)PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);
|
||||
if (g == NULL)
|
||||
return (PyVarObject *)PyErr_NoMemory();
|
||||
op = (PyVarObject *) FROM_GC(g);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue