Skip to content

Commit b137481

Browse files
committed
Revert "c-ext: use Py_REFCNT() instead of accessing ob_refcnt"
This reverts commit a83ac9f for causing crashes.
1 parent 46b0474 commit b137481

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

c-ext/backend_c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ size_t roundpow2(size_t i) {
313313
int safe_pybytes_resize(PyObject **obj, Py_ssize_t size) {
314314
PyObject *tmp;
315315

316-
if (Py_REFCNT(obj) == 1) {
316+
if ((*obj)->ob_refcnt == 1) {
317317
return _PyBytes_Resize(obj, size);
318318
}
319319

docs/news.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Changes
5757
* We now use GitHub's native ARM Linux runners to build wheels and run tests.
5858
Previously Linux ARM wheels were built inside a QEMU virtualized environment
5959
and we didn't run tests on this platform.
60-
* We now use `Py_REFCNT(obj)` instead of accessing `(*obj)->ob_refcnt` directly.
61-
This fixes a nogil / multi-threaded compile error. (#201)
6260
* We now `collections.abs.Buffer` on Python 3.12+ instead of `typing.ByteString`,
6361
as `typing.ByteString` was deprecated and later removed. (#238, #262)
6462

0 commit comments

Comments
 (0)