13#ifndef PYROOT_TMEMORYREGULATOR_H
14#define PYROOT_TMEMORYREGULATOR_H
38#include "../../cppyy/CPyCppyy/src/CPyCppyy.h"
39#include "../../cppyy/CPyCppyy/src/MemoryRegulator.h"
45#include <unordered_map>
49class RegulatorCleanup;
64 using ObjectMap_t = std::unordered_map<Cppyy::TCppObject_t, Cppyy::TCppType_t>;
#define ClassDefInlineNV(name, id)
A TObject-derived class to inject the memory regulation logic in the ROOT list of cleanups.
TMemoryRegulator fRegulator
void RecursiveRemove(TObject *object) final
Recursively remove this object from a list.
void CallClearProxiedObjects()
Manages TObject-derived objects created in a PyROOT application.
std::pair< bool, bool > RegisterHook(Cppyy::TCppObject_t, Cppyy::TCppType_t)
Register a hook that Cppyy runs when constructing an object.
std::unordered_map< Cppyy::TCppObject_t, Cppyy::TCppType_t > ObjectMap_t
TMemoryRegulator()
Constructor.
void CallCppyyRecursiveRemove(TObject *object)
Get the class id of the TObject being deleted and run Cppyy's RecursiveRemove.
void ClearProxiedObjects()
Clean up all tracked objects.
std::pair< bool, bool > UnregisterHook(Cppyy::TCppObject_t, Cppyy::TCppType_t)
Register a hook that Cppyy runs when deleting an object.
Mother of all ROOT objects.