OSDN Git Service

ART: Fixing build breakage.
authorChristina Wadsworth <cwadsworth@google.com>
Fri, 19 Aug 2016 20:28:19 +0000 (13:28 -0700)
committerChristina Wadsworth <cwadsworth@google.com>
Fri, 19 Aug 2016 20:28:19 +0000 (13:28 -0700)
Caused by Ic654a1fb9c1ae127dde59290bf36a23edb55ca8e.

Change-Id: Ia0c0fbcb6c8b141c5ee30a89ab6bc1c653916698

runtime/mirror/dex_cache.h
runtime/utils/dex_cache_arrays_layout-inl.h

index e04bde0..770c45d 100644 (file)
@@ -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} ... ]
index 4752a86..c2b2f65 100644 (file)
@@ -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 {