< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page
rev 52072 : 8211955: GC abstraction for LAB reserve

@@ -370,11 +370,12 @@
   return !gch->is_in_young(p);
 WB_END
 
 WB_ENTRY(jlong, WB_GetObjectSize(JNIEnv* env, jobject o, jobject obj))
   oop p = JNIHandles::resolve(obj);
-  return Universe::heap()->obj_size(p) * HeapWordSize;
+  size_t obj_size = p->size();
+  return Universe::heap()->cell_size(obj_size) * HeapWordSize;
 WB_END
 
 WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
   size_t alignment = Universe::heap()->collector_policy()->space_alignment();
   return (jlong)alignment;
< prev index next >