mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Added _Fini() routines to free up some memory
This commit is contained in:
parent
971a7aaeac
commit
fbbd57e4ca
3 changed files with 47 additions and 1 deletions
|
@ -790,3 +790,20 @@ PyTypeObject PyInt_Type = {
|
|||
0, /*tp_as_mapping*/
|
||||
(hashfunc)int_hash, /*tp_hash*/
|
||||
};
|
||||
|
||||
void
|
||||
PyInt_Fini()
|
||||
{
|
||||
#if NSMALLNEGINTS + NSMALLPOSINTS > 0
|
||||
int i;
|
||||
PyIntObject **p;
|
||||
|
||||
i = NSMALLNEGINTS + NSMALLPOSINTS;
|
||||
p = small_ints;
|
||||
while (--i >= 0) {
|
||||
Py_XDECREF(*p);
|
||||
*p++ = NULL;
|
||||
}
|
||||
#endif
|
||||
/* XXX Alas, the free list is not easily and safely freeable */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue