summaryrefslogtreecommitdiff
path: root/runtime/obj_ptr-inl.h
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-02-22 19:48:44 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-02-22 19:48:45 +0000
commit6902b51db7e5040c05fa3be0f9186ca5eff77f80 (patch)
tree4454a31f1ec932b3ac71e7a20f4796285b1fbcd3 /runtime/obj_ptr-inl.h
parent140e5c88058cb60542ba1f22b6fd1f2b66a239f8 (diff)
parentc73cb64585f301c8bb3b03a0684f6baead99b7ac (diff)
Merge "ART: Remove ObjPtr kPoison template parameter"
Diffstat (limited to 'runtime/obj_ptr-inl.h')
-rw-r--r--runtime/obj_ptr-inl.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/runtime/obj_ptr-inl.h b/runtime/obj_ptr-inl.h
index d0be6dc981..f2921daeaa 100644
--- a/runtime/obj_ptr-inl.h
+++ b/runtime/obj_ptr-inl.h
@@ -22,27 +22,27 @@
namespace art {
-template<class MirrorType, bool kPoison>
-inline bool ObjPtr<MirrorType, kPoison>::IsValid() const {
- if (!kPoison || IsNull()) {
+template<class MirrorType>
+inline bool ObjPtr<MirrorType>::IsValid() const {
+ if (!kObjPtrPoisoning || IsNull()) {
return true;
}
return GetCookie() == TrimCookie(Thread::Current()->GetPoisonObjectCookie());
}
-template<class MirrorType, bool kPoison>
-inline void ObjPtr<MirrorType, kPoison>::AssertValid() const {
- if (kPoison) {
+template<class MirrorType>
+inline void ObjPtr<MirrorType>::AssertValid() const {
+ if (kObjPtrPoisoning) {
CHECK(IsValid()) << "Stale object pointer " << PtrUnchecked() << " , expected cookie "
<< TrimCookie(Thread::Current()->GetPoisonObjectCookie()) << " but got " << GetCookie();
}
}
-template<class MirrorType, bool kPoison>
-inline uintptr_t ObjPtr<MirrorType, kPoison>::Encode(MirrorType* ptr) {
+template<class MirrorType>
+inline uintptr_t ObjPtr<MirrorType>::Encode(MirrorType* ptr) {
uintptr_t ref = reinterpret_cast<uintptr_t>(ptr);
DCHECK_ALIGNED(ref, kObjectAlignment);
- if (kPoison && ref != 0) {
+ if (kObjPtrPoisoning && ref != 0) {
DCHECK_LE(ref, 0xFFFFFFFFU);
ref >>= kObjectAlignmentShift;
// Put cookie in high bits.
@@ -53,8 +53,8 @@ inline uintptr_t ObjPtr<MirrorType, kPoison>::Encode(MirrorType* ptr) {
return ref;
}
-template<class MirrorType, bool kPoison>
-inline std::ostream& operator<<(std::ostream& os, ObjPtr<MirrorType, kPoison> ptr) {
+template<class MirrorType>
+inline std::ostream& operator<<(std::ostream& os, ObjPtr<MirrorType> ptr) {
// May be used for dumping bad pointers, do not use the checked version.
return os << ptr.PtrUnchecked();
}