diff options
author | Guido van Rossum <guido@python.org> | 1997-08-05 02:16:08 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-05 02:16:08 (GMT) |
commit | fbbd57e4ca4250e27b564d989a75caa0b1a4a9b5 (patch) | |
tree | 7e18c422e7879dc136a85dbc5db37727c785ab08 /Objects/intobject.c | |
parent | 971a7aaeac7b9c817ca68f11701b97bbd9aa54ab (diff) | |
download | cpython-fbbd57e4ca4250e27b564d989a75caa0b1a4a9b5.zip cpython-fbbd57e4ca4250e27b564d989a75caa0b1a4a9b5.tar.gz cpython-fbbd57e4ca4250e27b564d989a75caa0b1a4a9b5.tar.bz2 |
Added _Fini() routines to free up some memory
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r-- | Objects/intobject.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index 4db2a69..e09758b 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -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 */ +} |