8250269: Replace ATTRIBUTE_ALIGNED with alignas

Reviewed-by: rkennke, kbarrett
This commit is contained in:
Julian Waters 2023-08-22 06:12:28 +00:00
parent a66b5df14a
commit ab86d23adf
3 changed files with 2 additions and 9 deletions

View File

@ -50,7 +50,7 @@ class oopDesc;
#endif
#ifndef ATTRIBUTE_ALIGNED
#define ATTRIBUTE_ALIGNED(x)
#define ATTRIBUTE_ALIGNED(x) alignas(x)
#endif
#ifndef ATTRIBUTE_FLATTEN

View File

@ -141,7 +141,7 @@ inline int g_isfinite(jdouble f) { return isfinite(f); }
// temporarily disabled.
#define offset_of(klass,field) \
([]() { \
char space[sizeof (klass)] ATTRIBUTE_ALIGNED(16); \
alignas(16) char space[sizeof (klass)]; \
klass* dummyObj = (klass*)space; \
char* c = (char*)(void*)&dummyObj->field; \
return (size_t)(c - space); \
@ -160,8 +160,4 @@ inline int g_isfinite(jdouble f) { return isfinite(f); }
#define ALWAYSINLINE inline __attribute__ ((always_inline))
#define ATTRIBUTE_FLATTEN __attribute__ ((flatten))
// Alignment
//
#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
#endif // SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP

View File

@ -115,9 +115,6 @@ inline int g_isfinite(jdouble f) { return _finite(f); }
#define NOINLINE __declspec(noinline)
#define ALWAYSINLINE __forceinline
// Alignment
#define ATTRIBUTE_ALIGNED(x) __declspec(align(x))
#ifdef _M_ARM64
#define USE_VECTORED_EXCEPTION_HANDLING
#endif