Cleanup memory management. Use new char[] inside our overloaded new operator that clears out memory.
authorAndreas Gal <gal@uci.edu>
Mon, 30 Jun 2008 12:00:31 -0700
changeset 17367 a53a1fc6054cead81ab777e60e28b7eb8d5e8711
parent 17366 5669d738e1fee707b49c1fb9895ff8ca41b3f7d6
child 17368 4261e41eccc8010be4afc1d1cba2aa6be0d9ba31
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherdermozilla-central@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a1pre
Cleanup memory management. Use new char[] inside our overloaded new operator that clears out memory.
js/src/nanojit/avmplus.h
--- a/js/src/nanojit/avmplus.h
+++ b/js/src/nanojit/avmplus.h
@@ -116,17 +116,19 @@ public:
     {
         return &heap;
     }
 };
 
 inline void*
 operator new(size_t size, GC* gc)
 {
-    return GC::Alloc(size);
+    void* p = new char[size];
+    memset(p, 0, size);
+    return p;
 }
 
 #define DWB(x) x
 #define DRCWB(x) x
 
 #define MMGC_MEM_TYPE(x)
 
 typedef int FunctionID;