MCPcopy Create free account
hub / github.com/pybind/pybind11 / register_instance_impl

Function register_instance_impl

include/pybind11/detail/class.h:347–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345#endif
346
347inline 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}
355inline bool deregister_instance_impl(void *ptr, instance *self) {
356 assert(ptr);
357 return with_instance_map(ptr, [&](instance_map &instances) {

Callers 1

register_instanceFunction · 0.85

Calls 2

enable_try_inc_refFunction · 0.85
with_instance_mapFunction · 0.85

Tested by

no test coverage detected