aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-10-30 17:00:00 +0100
committerGitHub <noreply@github.com>2020-10-30 17:00:00 +0100
commit8b3414818f5289eac530bf38bcfbd7b2b851805c (patch)
tree7ca16e738927f6dd4be87aed29ae3a06817f9c3b /Include
parentDOC: attribute PyPy for the idea behind LOAD_ATTR cache (GH-23036) (diff)
downloadcpython-8b3414818f5289eac530bf38bcfbd7b2b851805c.tar.gz
cpython-8b3414818f5289eac530bf38bcfbd7b2b851805c.tar.bz2
cpython-8b3414818f5289eac530bf38bcfbd7b2b851805c.zip
bpo-42208: Pass tstate to _PyGC_CollectNoFail() (GH-23038)
Move private _PyGC_CollectNoFail() to the internal C API. Remove the private _PyGC_CollectIfEnabled() which was just an alias to the public PyGC_Collect() function since Python 3.8. Rename functions: * collect() => gc_collect_main() * collect_with_callback() => gc_collect_with_callback() * collect_generations() => gc_collect_generations()
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/objimpl.h4
-rw-r--r--Include/internal/pycore_gc.h4
2 files changed, 3 insertions, 5 deletions
diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h
index 15999a239f7..d83700e2a46 100644
--- a/Include/cpython/objimpl.h
+++ b/Include/cpython/objimpl.h
@@ -79,10 +79,6 @@ PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
-PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void);
-PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void);
-
-
/* Test if an object implements the garbage collector protocol */
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h
index da202a1df53..e2d47c90c10 100644
--- a/Include/internal/pycore_gc.h
+++ b/Include/internal/pycore_gc.h
@@ -161,7 +161,9 @@ struct _gc_runtime_state {
Py_ssize_t long_lived_pending;
};
-PyAPI_FUNC(void) _PyGC_InitState(struct _gc_runtime_state *);
+extern void _PyGC_InitState(struct _gc_runtime_state *);
+
+extern Py_ssize_t _PyGC_CollectNoFail(PyThreadState *tstate);
// Functions to clear types free lists