summaryrefslogtreecommitdiffstats
path: root/Modules/gcmodule.c
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2016-09-10 04:47:46 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2016-09-10 04:47:46 (GMT)
commitfef7e94fa12f21c09997bd02809e677830966646 (patch)
tree2f355b7146c4eb0426b93c29ac96072824361c13 /Modules/gcmodule.c
parent9e3ef52a35c2d45edca40f9e4208aa8a08d6cdfd (diff)
downloadcpython-fef7e94fa12f21c09997bd02809e677830966646.zip
cpython-fef7e94fa12f21c09997bd02809e677830966646.tar.gz
cpython-fef7e94fa12f21c09997bd02809e677830966646.tar.bz2
Don't run garbage collection on interpreter exit if it was explicitly disabled
by the user.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r--Modules/gcmodule.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 2575d96..754348e 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -1597,6 +1597,15 @@ PyGC_Collect(void)
}
Py_ssize_t
+_PyGC_CollectIfEnabled(void)
+{
+ if (!enabled)
+ return 0;
+
+ return PyGC_Collect();
+}
+
+Py_ssize_t
_PyGC_CollectNoFail(void)
{
Py_ssize_t n;