summaryrefslogtreecommitdiff
path: root/runtime/obj_ptr-inl.h
diff options
context:
space:
mode:
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();
}