15#include "../../cppyy/CPyCppyy/src/ProxyWrappers.h"
16#include "../../cppyy/CPyCppyy/src/CPPInstance.h"
22using TrackedObjects_t = std::unordered_map<Cppyy::TCppObject_t, Cppyy::TCppType_t>;
24TrackedObjects_t &GetTrackedObjects()
26 thread_local TrackedObjects_t trackedObjects{};
27 return trackedObjects;
38 return objects.find(key);
44 GetTrackedObjects().insert({cppobj, klass});
52 if (
auto it = GetObjectIt(GetTrackedObjects(), cppobj); it != GetTrackedObjects().end()) {
53 GetTrackedObjects().erase(it);
75 auto &trackedObjects = GetTrackedObjects();
77 it != trackedObjects.end()) {
79 const auto cppobj = it->first;
80 const auto klassid = it->second;
81 trackedObjects.erase(it);
static bool RecursiveRemove(Cppyy::TCppObject_t cppobj, Cppyy::TCppType_t klass)
static void SetUnregisterHook(MemHook_t h)
static void SetRegisterHook(MemHook_t h)
Mother of all ROOT objects.
RPY_EXPORTED bool IsSubtype(TCppType_t derived, TCppType_t base)
RPY_EXPORTED TCppScope_t GetScope(const std::string &scope_name)
void CallCppyyRecursiveRemove(TObject *object)
Get the class id of the TObject being deleted and run Cppyy's RecursiveRemove.
RegulatorCleanup()
Injects custom registration/deregistration logic into cppyy's memory regulator.