Loading include/utils/RefBase.h +6 −5 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ #define ANDROID_REF_BASE_H #include <cutils/atomic.h> #include <utils/TextOutput.h> #include <stdint.h> #include <sys/types.h> Loading @@ -27,6 +26,10 @@ // --------------------------------------------------------------------------- namespace android { class TextOutput; TextOutput& printStrongPointer(TextOutput& to, const void* val); TextOutput& printWeakPointer(TextOutput& to, const void* val); template<typename T> class wp; // --------------------------------------------------------------------------- Loading Loading @@ -427,8 +430,7 @@ sp<T>::sp(T* p, weakref_type* refs) template <typename T> inline TextOutput& operator<<(TextOutput& to, const sp<T>& val) { to << "sp<>(" << val.get() << ")"; return to; return printStrongPointer(to, val.get()); } // --------------------------------------------------------------------------- Loading Loading @@ -585,8 +587,7 @@ void wp<T>::clear() template <typename T> inline TextOutput& operator<<(TextOutput& to, const wp<T>& val) { to << "wp<>(" << val.unsafe_get() << ")"; return to; return printWeakPointer(to, val.unsafe_get()); } }; // namespace android Loading libs/utils/RefBase.cpp +17 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <utils/KeyedVector.h> #include <utils/Log.h> #include <utils/threads.h> #include <utils/TextOutput.h> #include <stdlib.h> #include <stdio.h> Loading Loading @@ -531,4 +532,19 @@ void RefBase::onLastWeakRef(const void* /*id*/) { } // --------------------------------------------------------------------------- TextOutput& printStrongPointer(TextOutput& to, const void* val) { to << "sp<>(" << val << ")"; return to; } TextOutput& printWeakPointer(TextOutput& to, const void* val) { to << "wp<>(" << val << ")"; return to; } }; // namespace android Loading
include/utils/RefBase.h +6 −5 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ #define ANDROID_REF_BASE_H #include <cutils/atomic.h> #include <utils/TextOutput.h> #include <stdint.h> #include <sys/types.h> Loading @@ -27,6 +26,10 @@ // --------------------------------------------------------------------------- namespace android { class TextOutput; TextOutput& printStrongPointer(TextOutput& to, const void* val); TextOutput& printWeakPointer(TextOutput& to, const void* val); template<typename T> class wp; // --------------------------------------------------------------------------- Loading Loading @@ -427,8 +430,7 @@ sp<T>::sp(T* p, weakref_type* refs) template <typename T> inline TextOutput& operator<<(TextOutput& to, const sp<T>& val) { to << "sp<>(" << val.get() << ")"; return to; return printStrongPointer(to, val.get()); } // --------------------------------------------------------------------------- Loading Loading @@ -585,8 +587,7 @@ void wp<T>::clear() template <typename T> inline TextOutput& operator<<(TextOutput& to, const wp<T>& val) { to << "wp<>(" << val.unsafe_get() << ")"; return to; return printWeakPointer(to, val.unsafe_get()); } }; // namespace android Loading
libs/utils/RefBase.cpp +17 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <utils/KeyedVector.h> #include <utils/Log.h> #include <utils/threads.h> #include <utils/TextOutput.h> #include <stdlib.h> #include <stdio.h> Loading Loading @@ -531,4 +532,19 @@ void RefBase::onLastWeakRef(const void* /*id*/) { } // --------------------------------------------------------------------------- TextOutput& printStrongPointer(TextOutput& to, const void* val) { to << "sp<>(" << val << ")"; return to; } TextOutput& printWeakPointer(TextOutput& to, const void* val) { to << "wp<>(" << val << ")"; return to; } }; // namespace android