diff options
author | Aliaksey Kandratsenka <alk@tut.by> | 2014-01-04 13:07:35 -0800 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2014-01-04 13:59:49 -0800 |
commit | 6630b24e27c6a62727fe73aaae21dcc7364b8fee (patch) | |
tree | 8803559e32b40ac4158f9f5188374cd41807e671 | |
parent | a15115271cc475509b17bf7fecbe1ac4966baf2e (diff) | |
download | gperftools-6630b24e27c6a62727fe73aaae21dcc7364b8fee.tar.gz |
Removed unused AtomicPtr::CompareAndSwap
-rw-r--r-- | src/malloc_hook-inl.h | 8 | ||||
-rw-r--r-- | src/malloc_hook.cc | 12 |
2 files changed, 0 insertions, 20 deletions
diff --git a/src/malloc_hook-inl.h b/src/malloc_hook-inl.h index b45a3d4..b98e920 100644 --- a/src/malloc_hook-inl.h +++ b/src/malloc_hook-inl.h @@ -75,14 +75,6 @@ class AtomicPtr { // This is a full-barrier instruction. PtrT Exchange(PtrT new_val); - // Atomically executes: - // result = data_ - // if (data_ == old_val) - // data_ = new_val; - // return result; - // This is a full-barrier instruction. - PtrT CompareAndSwap(PtrT old_val, PtrT new_val); - // Not private so that the class is an aggregate and can be // initialized by the linker. Don't access this directly. AtomicWord data_; diff --git a/src/malloc_hook.cc b/src/malloc_hook.cc index f60d12a..b9fa520 100644 --- a/src/malloc_hook.cc +++ b/src/malloc_hook.cc @@ -174,18 +174,6 @@ PtrT AtomicPtr<PtrT>::Exchange(PtrT new_val) { return old_val; } -template<typename PtrT> -PtrT AtomicPtr<PtrT>::CompareAndSwap(PtrT old_val, PtrT new_val) { - base::subtle::MemoryBarrier(); // Release semantics. - PtrT retval = reinterpret_cast<PtrT>(static_cast<AtomicWord>( - base::subtle::NoBarrier_CompareAndSwap( - &data_, - reinterpret_cast<AtomicWord>(old_val), - reinterpret_cast<AtomicWord>(new_val)))); - base::subtle::MemoryBarrier(); // And acquire semantics. - return retval; -} - AtomicPtr<MallocHook::NewHook> new_hook_ = { 0 }; AtomicPtr<MallocHook::DeleteHook> delete_hook_ = { 0 }; AtomicPtr<MallocHook::PreMmapHook> premmap_hook_ = { 0 }; |