mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Move PyObject_Malloc and PyObject_Free to obmalloc.c.
This commit is contained in:
parent
58aa861fa2
commit
bdf0eedb68
1 changed files with 2 additions and 21 deletions
|
|
@ -137,6 +137,8 @@ _PyObject_NewVar(PyTypeObject *tp, int nitems)
|
||||||
return PyObject_INIT_VAR(op, tp, nitems);
|
return PyObject_INIT_VAR(op, tp, nitems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* for binary compatibility with 2.2 */
|
||||||
|
#undef _PyObject_Del
|
||||||
void
|
void
|
||||||
_PyObject_Del(PyObject *op)
|
_PyObject_Del(PyObject *op)
|
||||||
{
|
{
|
||||||
|
|
@ -1916,27 +1918,6 @@ PyMem_Free(void *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Python's object malloc wrappers (see objimpl.h) */
|
|
||||||
|
|
||||||
void *
|
|
||||||
PyObject_Malloc(size_t nbytes)
|
|
||||||
{
|
|
||||||
return PyObject_MALLOC(nbytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
PyObject_Realloc(void *p, size_t nbytes)
|
|
||||||
{
|
|
||||||
return PyObject_REALLOC(p, nbytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
PyObject_Free(void *p)
|
|
||||||
{
|
|
||||||
PyObject_FREE(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* These methods are used to control infinite recursion in repr, str, print,
|
/* These methods are used to control infinite recursion in repr, str, print,
|
||||||
etc. Container objects that may recursively contain themselves,
|
etc. Container objects that may recursively contain themselves,
|
||||||
e.g. builtin dictionaries and lists, should used Py_ReprEnter() and
|
e.g. builtin dictionaries and lists, should used Py_ReprEnter() and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue