translation.rawrefcount_link_prefix¶
- name: rawrefcount_link_prefix
- description: Store cpyext’s rawrefcount ob_pypy_link in a hidden prefix word before ob_refcnt, instead of as a regular PyObject header field, and make the REFCNT_FROM_PYPY tag permanent (it marks the prefix; the GC then never subtracts it, so the dead-object test becomes ob_refcnt == REFCNT_FROM_PYPY rather than 0). Needed so PyObject’s visible layout matches CPython’s {ob_refcnt, ob_type} exactly (abi3 wheel loading); must only be set by a target whose cpyext allocator actually reserves that prefix word and whose Py_DECREF implements the two-condition dealloc test.
- command-line: –translation-rawrefcount_link_prefix
- command-line for negation: –no-translation-rawrefcount_link_prefix
- option type: boolean option
- default: False
Select the PyObject model used by cpyext’s rawrefcount: store ob_pypy_link
in a hidden word before ob_refcnt instead of as a visible header field, and
make the REFCNT_FROM_PYPY tag permanent. This makes the visible PyObject
header identical to CPython’s so that abi3 wheels can be loaded. Only a
cpyext whose allocator reserves the prefix word may turn this on. See
pypy/doc/discussion/rawrefcount.rst.