From 5b937e3644dba95b6e1c3e868fc567ccf991c2ea Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Thu, 1 Mar 2018 17:28:38 +0000 Subject: [PATCH] Hadrons: VM memory profiling fix --- extras/Hadrons/VirtualMachine.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extras/Hadrons/VirtualMachine.cc b/extras/Hadrons/VirtualMachine.cc index d47bafb7..c91667e7 100644 --- a/extras/Hadrons/VirtualMachine.cc +++ b/extras/Hadrons/VirtualMachine.cc @@ -424,11 +424,17 @@ void VirtualMachine::memoryProfile(const unsigned int address) cleanEnvironment(); for (auto &in: m->getInput()) { - memoryProfile(env().getObjectModule(in)); + if (!env().hasCreatedObject(in)) + { + memoryProfile(env().getObjectModule(in)); + } } for (auto &ref: m->getReference()) { - memoryProfile(env().getObjectModule(ref)); + if (!env().hasCreatedObject(ref)) + { + memoryProfile(env().getObjectModule(ref)); + } } m->setup(); updateProfile(address);