harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r646659 - /harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
Date Thu, 10 Apr 2008 06:03:59 GMT
Author: mfursov
Date: Wed Apr  9 23:03:57 2008
New Revision: 646659

URL: http://svn.apache.org/viewvc?rev=646659&view=rev
Log:
Fix of memory leak in JET compiler: HARMONY-5308 [drlvm][jit] ...

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?rev=646659&r1=646658&r2=646659&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Wed Apr  9 23:03:57 2008
@@ -511,9 +511,11 @@
     //
     
     //register profiler counters  mapping info if present
+    std::vector<uint32> profiler_counters_vec; //will automatically be deleted on exit
from this method
     if (!m_profileCountersMap.empty()) {
         m_infoBlock.num_profiler_counters = (uint32)m_profileCountersMap.size();
-        m_infoBlock.profiler_counters_map =  new uint32[m_infoBlock.num_profiler_counters];
+        profiler_counters_vec.resize(m_infoBlock.num_profiler_counters, 0);
+        m_infoBlock.profiler_counters_map = &profiler_counters_vec.front();
         for (size_t i =0; i<m_profileCountersMap.size(); i++) {
             ProfileCounterInfo& info = m_profileCountersMap[i];
             uint32 offset = ProfileCounterInfo::getInstOffset(info.offsetInfo) + (info.bb->addr
- m_vmCode);



Mime
View raw message