)]}'
{
  "commit": "70b6fd30f4c8f0bbdba04b6bb776ffb063bc8681",
  "tree": "96566ef1aea37e9b64d8eb6dd49d908a183caad0",
  "parents": [
    "3b62426106e475a98346645727750e07ad0cdb6e"
  ],
  "author": {
    "name": "Ralf W. Grosse-Kunstleve",
    "email": "rwgkio@gmail.com",
    "time": "Sun Mar 29 22:03:31 2026 +0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun Mar 29 08:03:31 2026 -0700"
  },
  "message": "Fix TSS key exhaustion in implicitly_convertible() (gh-5975) (#6020)\n\nReplace `static thread_specific_storage\u003cint\u003e` with `thread_local bool`\nin the implicit conversion reentrancy guard. Since implicitly_convertible\nis a template function, each unique \u003cInputType, OutputType\u003e pair created\nits own TSS key via PyThread_tss_create(). Projects with hundreds of\nmodules and many implicit conversions could exhaust PTHREAD_KEYS_MAX\n(1024 on Linux, 512 on macOS), especially on Python 3.12+ where CPython\nitself consumes more TSS keys for subinterpreter support.\n\nthread_local bool is safe here because:\n- bool is trivially destructible, so it works on all C++11 platforms\n  including older macOS (the concern that motivated the TSS approach in\n  PR #5777 applied only to types with non-trivial destructors needing\n  __cxa_thread_atexit runtime support)\n- Each thread gets its own copy, so it is thread-safe for free-threading\n- Subinterpreter sharing is benign: the guard prevents recursive implicit\n  conversions on the same thread regardless of which interpreter is active\n- The v3.0.0 code already used thread_local bool under Py_GIL_DISABLED\n\nThis effectively reverts the core change from PR #5777 while keeping\nthe non-copyable/non-movable set_flag guard.\n\nMade-with: Cursor",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6c269adbe18e7116019635fd40cc7c9f2e576437",
      "old_mode": 33188,
      "old_path": "include/pybind11/pybind11.h",
      "new_id": "0d03f4fa60c9e2236182f20655da6dec948bd0a7",
      "new_mode": 33188,
      "new_path": "include/pybind11/pybind11.h"
    }
  ]
}
