summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/mirror/dex_cache.h2
-rw-r--r--runtime/utils/dex_cache_arrays_layout-inl.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index e04bde04b4..770c45d558 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -35,7 +35,7 @@ namespace mirror {
class String;
-struct StringDexCachePair {
+struct PACKED(8) StringDexCachePair {
GcRoot<String> string_pointer;
uint32_t string_index;
// The array is initially [ {0,0}, {0,0}, {0,0} ... ]
diff --git a/runtime/utils/dex_cache_arrays_layout-inl.h b/runtime/utils/dex_cache_arrays_layout-inl.h
index 4752a86522..c2b2f657f8 100644
--- a/runtime/utils/dex_cache_arrays_layout-inl.h
+++ b/runtime/utils/dex_cache_arrays_layout-inl.h
@@ -50,7 +50,7 @@ inline constexpr size_t DexCacheArraysLayout::Alignment() {
// GcRoot<> alignment is 4, i.e. lower than or equal to the pointer alignment.
static_assert(alignof(GcRoot<mirror::Class>) == 4, "Expecting alignof(GcRoot<>) == 4");
static_assert(alignof(mirror::StringDexCacheType) == 8, "Expecting alignof(StringDexCacheType) == 8");
- return sizeof(mirror::StringDexCacheType);
+ return alignof(mirror::StringDexCacheType);
}
template <typename T>
@@ -100,7 +100,7 @@ inline size_t DexCacheArraysLayout::StringsSize(size_t num_elements) const {
}
inline size_t DexCacheArraysLayout::StringsAlignment() const {
- return alignof(uint64_t);
+ return alignof(mirror::StringDexCacheType);
}
inline size_t DexCacheArraysLayout::FieldOffset(uint32_t field_idx) const {