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.
This was found while working onJDK-8178489.
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.
This was found while working on
- relates to
-
JDK-8178489 Make align functions more type safe and consistent
-
- Resolved
-