Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdf0eed

Browse files
committed
Move PyObject_Malloc and PyObject_Free to obmalloc.c.
1 parent 58aa861 commit bdf0eed

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

Objects/object.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ _PyObject_NewVar(PyTypeObject *tp, int nitems)
137137
return PyObject_INIT_VAR(op, tp, nitems);
138138
}
139139

140+
/* for binary compatibility with 2.2 */
141+
#undef _PyObject_Del
140142
void
141143
_PyObject_Del(PyObject *op)
142144
{
@@ -1916,27 +1918,6 @@ PyMem_Free(void *p)
19161918
}
19171919

19181920

1919-
/* Python's object malloc wrappers (see objimpl.h) */
1920-
1921-
void *
1922-
PyObject_Malloc(size_t nbytes)
1923-
{
1924-
return PyObject_MALLOC(nbytes);
1925-
}
1926-
1927-
void *
1928-
PyObject_Realloc(void *p, size_t nbytes)
1929-
{
1930-
return PyObject_REALLOC(p, nbytes);
1931-
}
1932-
1933-
void
1934-
PyObject_Free(void *p)
1935-
{
1936-
PyObject_FREE(p);
1937-
}
1938-
1939-
19401921
/* These methods are used to control infinite recursion in repr, str, print,
19411922
etc. Container objects that may recursively contain themselves,
19421923
e.g. builtin dictionaries and lists, should used Py_ReprEnter() and

0 commit comments

Comments
 (0)