| 345 | #endif |
| 346 | |
| 347 | inline bool register_instance_impl(void *ptr, instance *self) { |
| 348 | assert(ptr); |
| 349 | #ifdef Py_GIL_DISABLED |
| 350 | enable_try_inc_ref(reinterpret_cast<PyObject *>(self)); |
| 351 | #endif |
| 352 | with_instance_map(ptr, [&](instance_map &instances) { instances.emplace(ptr, self); }); |
| 353 | return true; // unused, but gives the same signature as the deregister func |
| 354 | } |
| 355 | inline bool deregister_instance_impl(void *ptr, instance *self) { |
| 356 | assert(ptr); |
| 357 | return with_instance_map(ptr, [&](instance_map &instances) { |
no test coverage detected