[Lldb-commits] [lldb] [lldb] Use PyBytes and PyByteArray in Python Data Objects unittest (PR #82098)

Will Hawkins via lldb-commits lldb-commits at lists.llvm.org
Sat Feb 17 18:27:18 PST 2024


hawkinsw wrote:

> Use a Python Bytes and ByteArray object instead of Integers for TestOwnedReferences and TestBorrowedReferences. These two tests were failing when building against Python 3.12 because these Integer objects had a refcount of 4294967296 (-1). I didn't dig into it, but I suspect the Python runtime has adopted an optimization to decrease refcounting traffic for these simple objects.

Perhaps related to ...

https://github.com/python/cpython/pull/30872/files#diff-1a6e70e2beeecad88840c67284ac4d54a36998029244771fcc820e801390726a

I was curious and investigated. Whether that is the *exact* change, it seems to confirm your hypothesis that there is special refcounting code for certain types of Python objects. Would you agree with that?

I hope that helps!

https://github.com/llvm/llvm-project/pull/82098


More information about the lldb-commits mailing list