Bug report
Bug description:
Hi,
I am unsure if this intentional or not so apologies if this turns out not to be a bug.
The code for _Py_RefcntAdd does not include _Py_INCREF_STAT_INC. This appears to mean the statistics do not track these additions to the reference count, which are increments (although not increments by 1, they are increasing the ref count in a single operation).
|
static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n) |
I believe this may be an oversight because this stat should be tracked, and also because the corresponding decrement ref count code does call _Py_DECREF_STAT_INC (e.g.
)
I have checked the callers of _Py_RefcntAdd (in listobject.c and tupleobject.c) and they do not separately perform the stats tracking.
Is this an issue or is there a reason this ref count increment is excluded?
Thanks,
Ed
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Linux, macOS
Linked PRs
Bug report
Bug description:
Hi,
I am unsure if this intentional or not so apologies if this turns out not to be a bug.
The code for
_Py_RefcntAdddoes not include_Py_INCREF_STAT_INC. This appears to mean the statistics do not track these additions to the reference count, which are increments (although not increments by1, they are increasing the ref count in a single operation).cpython/Include/internal/pycore_object.h
Line 121 in ad9d059
I believe this may be an oversight because this stat should be tracked, and also because the corresponding decrement ref count code does call
_Py_DECREF_STAT_INC(e.g.cpython/Include/internal/pycore_object.h
Line 383 in ad9d059
I have checked the callers of
_Py_RefcntAdd(inlistobject.candtupleobject.c) and they do not separately perform the stats tracking.Is this an issue or is there a reason this ref count increment is excluded?
Thanks,
Ed
CPython versions tested on:
3.12, 3.13
Operating systems tested on:
Linux, macOS
Linked PRs