diff options
author | Victor Stinner <vstinner@python.org> | 2023-06-23 03:00:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-23 03:00:56 (GMT) |
commit | 6a80664ef1200008d5beb1584e03d779ef30cc58 (patch) | |
tree | e5ad14c21ed2aa9b040de42ca7fac6b6caa62b46 /Include | |
parent | 7b3ed5b29fd33ecfdaedc3bb0b8f6c05ded68361 (diff) | |
download | cpython-6a80664ef1200008d5beb1584e03d779ef30cc58.zip cpython-6a80664ef1200008d5beb1584e03d779ef30cc58.tar.gz cpython-6a80664ef1200008d5beb1584e03d779ef30cc58.tar.bz2 |
gh-105927: Remove _PyWeakref_GetWeakrefCount() (#106007)
Remove _PyWeakref_GetWeakrefCount() and _PyWeakref_ClearRef() from
the public C API: move them to the internal C API.
Refactor also _weakref_getweakrefs() code to make it more readable.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/weakrefobject.h | 4 | ||||
-rw-r--r-- | Include/internal/pycore_weakref.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Include/cpython/weakrefobject.h b/Include/cpython/weakrefobject.h index fd79fdc..6bf1655 100644 --- a/Include/cpython/weakrefobject.h +++ b/Include/cpython/weakrefobject.h @@ -32,10 +32,6 @@ struct _PyWeakReference { vectorcallfunc vectorcall; }; -PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); - -PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); - static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) { PyWeakReference *ref; PyObject *obj; diff --git a/Include/internal/pycore_weakref.h b/Include/internal/pycore_weakref.h index f31b124..51b2bb6 100644 --- a/Include/internal/pycore_weakref.h +++ b/Include/internal/pycore_weakref.h @@ -46,6 +46,10 @@ static inline int _PyWeakref_IS_DEAD(PyObject *ref_obj) { return (Py_REFCNT(obj) == 0); } +extern Py_ssize_t _PyWeakref_GetWeakrefCount(PyWeakReference *head); + +extern void _PyWeakref_ClearRef(PyWeakReference *self); + #ifdef __cplusplus } #endif |