diff options
author | Peter Bierma <zintensitydev@gmail.com> | 2024-11-13 13:27:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 13:27:16 (GMT) |
commit | d00878b06a05ea04790813dba70b09cc1d11bf45 (patch) | |
tree | e7508c9d7769379ae50a0f6e7572a61bb6dc952f /Include | |
parent | 29b5323c4567dc7772e1d30a7ba1cbad52fe10a9 (diff) | |
download | cpython-d00878b06a05ea04790813dba70b09cc1d11bf45.zip cpython-d00878b06a05ea04790813dba70b09cc1d11bf45.tar.gz cpython-d00878b06a05ea04790813dba70b09cc1d11bf45.tar.bz2 |
gh-123619: Add an unstable C API function for enabling deferred reference counting (GH-123635)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/object.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/cpython/object.h b/Include/cpython/object.h index f0f6179..e479702 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -527,3 +527,10 @@ typedef enum { typedef int (*PyRefTracer)(PyObject *, PyRefTracerEvent event, void *); PyAPI_FUNC(int) PyRefTracer_SetTracer(PyRefTracer tracer, void *data); PyAPI_FUNC(PyRefTracer) PyRefTracer_GetTracer(void**); + +/* Enable PEP-703 deferred reference counting on the object. + * + * Returns 1 if deferred reference counting was successfully enabled, and + * 0 if the runtime ignored it. This function cannot fail. + */ +PyAPI_FUNC(int) PyUnstable_Object_EnableDeferredRefcount(PyObject *); |