Logo
8.0
  • What is PyPy?
  • Goals and Architecture Overview
  • Downloading and Installing PyPy
  • Building PyPy from Source
  • Translating on Windows
  • Frequently Asked Questions
  • Differences between PyPy and CPython
  • Writing extension modules for pypy
  • Garbage collector documentation and configuration
  • JIT hooks
  • Resetting the JIT
  • Application-level Stackless features
  • The __pypy__ module
  • PyPy’s sandboxing features
  • Software Transactional Memory
  • Remote Debugging
  • Contributing Guidelines
  • PyPy’s Configuration Handling
  • Potential Project List
  • Project Documentation
  • Source Code Documentation
    • The Object Space
    • Bytecode Interpreter
    • Standard Interpreter Optimizations
    • PyPy Parser
    • Configuration Options for PyPy
      • PyPy Python interpreter options
      • General translation options
      • translation
        • translation.continuation
        • translation.type_system
        • translation.backend
        • translation.shared
        • translation.log
        • translation.gc
        • translation.gctransformer
        • translation.gcremovetypeptr
        • translation.gcrootfinder
        • translation.thread
        • translation.sandbox
        • translation.rweakref
        • translation.jit
        • translation.jit_backend
        • translation.jit_profiler
        • translation.check_str_without_nul
        • translation.verbose
        • translation.cc
        • translation.profopt
        • translation.profoptargs
        • translation.instrument
        • translation.countmallocs
        • translation.countfieldaccess
        • translation.fork_before
        • translation.dont_write_c_files
        • translation.instrumentctl
        • translation.output
        • translation.secondaryentrypoints
        • translation.dump_static_data_info
        • translation.no__thread
        • translation.make_jobs
        • translation.list_comprehension_operations
        • translation.withsmallfuncsets
        • translation.taggedpointers
        • translation.keepgoing
        • translation.lldebug
        • translation.lldebug0
        • translation.lto
        • translation.icon
        • translation.manifest
        • translation.libname
        • translation.backendopt
        • translation.platform
        • translation.split_gc_address_space
        • translation.rawrefcount_link_prefix
        • translation.reverse_debugger
        • translation.rpython_translate
      • objspace
      • The --opt or -O translation option
    • Command line reference
    • PyPy directory cross-reference
  • PyPy’s Release Process
  • Historical release notes
  • Changelogs
  • Contributors
  • Glossary
PyPy
  • Project Documentation
  • Configuration Options for PyPy
  • translation
  • translation.rawrefcount_link_prefix
  • View page source

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.

Previous Next

© Copyright 2024, The PyPy Project. Last updated on Nov 13, 2026.

Built with Sphinx using a theme provided by Read the Docs.