RFR: 8178490: Usages of is_object_aligned with pointers are broken

Stefan Karlsson stefan.karlsson at oracle.com
Thu Jun 22 09:16:45 UTC 2017


Hi all,

Please review this patch to fix and strengthen is_object_aligned checks 
when pointers are passed in:

http://cr.openjdk.java.net/~stefank/8178490/webrev.00/
https://bugs.openjdk.java.net/browse/JDK-8178490

is_object_aligned only works correctly for sizes measured in words.

When a pointer is passed into:

inline bool is_object_aligned(intptr_t addr) {
   return addr == align_object_size(addr);
}

inline intptr_t align_object_size(intptr_t size) { 
 
 

   return align_size_up(size, MinObjAlignment); 
 
 

}

the pointer is incorrectly interpreted as a word size and the alignment 
is checked against MinObjectAligment instead of MinObjectAlignmentInBytes

Tested with JPRT together with different patches for:
  8178489 Make align functions more type safe and consistent

Thanks,
StefanK



More information about the hotspot-gc-dev mailing list