< prev index next >

src/share/vm/oops/constMethod.hpp

Print this page
rev 12709 : 8170812: Metaspace corruption caused by incorrect memory size for MethodCounters
Reviewed-by: kbarrett, coleenp

@@ -357,11 +357,13 @@
     u2* addr = generic_signature_index_addr();
     *addr = index;
   }
 
   // Sizing
-  static int header_size() { return sizeof(ConstMethod)/wordSize; }
+  static int header_size() {
+    return align_size_up(sizeof(ConstMethod), wordSize) / wordSize;
+  }
 
   // Size needed
   static int size(int code_size, InlineTableSizes* sizes);
 
   int size() const                    { return _constMethod_size;}
< prev index next >