diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2015-02-23 19:30:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-02-23 19:30:29 +0000 |
commit | 38fee8ef4bc0f4dbe2c6d1f5585895f0c4d16984 (patch) | |
tree | bdb08a2cbcf277ab7f02626a23b52a3fdf272ffe | |
parent | bad712e2576631529381280e52e36905dda5f048 (diff) | |
parent | 9e47bfa71d42df101aff9d156a1b296eaf6566a2 (diff) | |
download | art-38fee8ef4bc0f4dbe2c6d1f5585895f0c4d16984.zip art-38fee8ef4bc0f4dbe2c6d1f5585895f0c4d16984.tar.gz art-38fee8ef4bc0f4dbe2c6d1f5585895f0c4d16984.tar.bz2 |
Merge "Avoid unaligned accesses (SIGBUG/BUS_ADRALN) in IRT."
-rw-r--r-- | runtime/gc_root.h | 2 | ||||
-rw-r--r-- | runtime/indirect_reference_table.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/runtime/gc_root.h b/runtime/gc_root.h index 7e0be64..c5feda5 100644 --- a/runtime/gc_root.h +++ b/runtime/gc_root.h @@ -71,7 +71,7 @@ class RootInfo { typedef void (RootCallback)(mirror::Object** root, void* arg, const RootInfo& root_info); template<class MirrorType> -class PACKED(4) GcRoot { +class GcRoot { public: template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier> ALWAYS_INLINE MirrorType* Read() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h index 7f7870a..576a604 100644 --- a/runtime/indirect_reference_table.h +++ b/runtime/indirect_reference_table.h @@ -197,7 +197,7 @@ union IRTSegmentState { // Contains multiple entries but only one active one, this helps us detect use after free errors // since the serial stored in the indirect ref wont match. static const size_t kIRTPrevCount = kIsDebugBuild ? 7 : 3; -class PACKED(4) IrtEntry { +class IrtEntry { public: void Add(mirror::Object* obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { ++serial_; @@ -218,6 +218,8 @@ class PACKED(4) IrtEntry { uint32_t serial_; GcRoot<mirror::Object> references_[kIRTPrevCount]; }; +static_assert(sizeof(IrtEntry) == (1 + kIRTPrevCount) * sizeof(uintptr_t), + "Unexpected sizeof(IrtEntry)"); class IrtIterator { public: |