summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-02-20 13:43:06 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-02-20 18:51:14 +0000
commitf15e067185a832a3d0b3f574c28faf808f6e2dff (patch)
tree25e8b47d907a500a27af51050d0f20e4f8dd9988
parent8701bf5f321ccad60ee948833fc3208ae6ea51df (diff)
Updated PACKED to alignas for DexCachePair and TLS data structures
Some members are non-POD and not usable with PACKED (packed-non-pod warning). Bug: 324278047 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I09b44e0300fa9b354e3e5bbd3a40d50658ea7260
-rw-r--r--runtime/mirror/class.h2
-rw-r--r--runtime/mirror/dex_cache.h4
-rw-r--r--runtime/thread.h6
3 files changed, 6 insertions, 6 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index 642d675808..b69086c971 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -76,7 +76,7 @@ class DexCache;
class Field;
class IfTable;
class Method;
-template <typename T> struct PACKED(8) DexCachePair;
+template <typename T> struct alignas(8) DexCachePair;
// C++ mirror of java.lang.Class
class EXPORT MANAGED Class final : public Object {
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index 921d8028e7..d93464759f 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -53,7 +53,7 @@ class DexCache;
class MethodType;
class String;
-template <typename T> struct PACKED(8) DexCachePair {
+template <typename T> struct alignas(8) DexCachePair {
GcRoot<T> object;
uint32_t index;
// The array is initially [ {0,0}, {0,0}, {0,0} ... ]
@@ -90,7 +90,7 @@ template <typename T> struct PACKED(8) DexCachePair {
T* GetObjectForIndex(uint32_t idx) REQUIRES_SHARED(Locks::mutator_lock_);
};
-template <typename T> struct PACKED(2 * __SIZEOF_POINTER__) NativeDexCachePair {
+template <typename T> struct alignas(2 * __SIZEOF_POINTER__) NativeDexCachePair {
T* object;
size_t index;
// This is similar to DexCachePair except that we're storing a native pointer
diff --git a/runtime/thread.h b/runtime/thread.h
index 5a9c55aa14..b1afac1345 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -1946,7 +1946,7 @@ class EXPORT Thread {
// first if possible.
/***********************************************************************************************/
- struct PACKED(4) tls_32bit_sized_values {
+ struct alignas(4) tls_32bit_sized_values {
// We have no control over the size of 'bool', but want our boolean fields
// to be 4-byte quantities.
using bool32_t = uint32_t;
@@ -2074,7 +2074,7 @@ class EXPORT Thread {
uint32_t shared_method_hotness;
} tls32_;
- struct PACKED(8) tls_64bit_sized_values {
+ struct alignas(8) tls_64bit_sized_values {
tls_64bit_sized_values() : trace_clock_base(0) {
}
@@ -2084,7 +2084,7 @@ class EXPORT Thread {
RuntimeStats stats;
} tls64_;
- struct PACKED(sizeof(void*)) tls_ptr_sized_values {
+ struct alignas(sizeof(void*)) tls_ptr_sized_values {
tls_ptr_sized_values() : card_table(nullptr),
exception(nullptr),
stack_end(nullptr),