< prev index next >

src/hotspot/share/gc/z/zPage.inline.hpp

Print this page

        

@@ -292,10 +292,13 @@
   if (new_top != offset) {
     // Failed to undo allocation, not the last allocated object
     return false;
   }
 
+  // Clear memory
+  ZUtils::zero(addr, size);
+
   _top = new_top;
 
   // Success
   return true;
 }

@@ -312,10 +315,13 @@
     if (new_top != offset) {
       // Failed to undo allocation, not the last allocated object
       return false;
     }
 
+    // Clear memory
+    ZUtils::zero(addr, size);
+
     const uintptr_t prev_top = Atomic::cmpxchg(new_top, &_top, old_top);
     if (prev_top == old_top) {
       // Success
       return true;
     }
< prev index next >