summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/atomic_dex_ref_map-inl.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/utils/atomic_dex_ref_map-inl.h b/compiler/utils/atomic_dex_ref_map-inl.h
index 4bd323dadb..9915498acc 100644
--- a/compiler/utils/atomic_dex_ref_map-inl.h
+++ b/compiler/utils/atomic_dex_ref_map-inl.h
@@ -81,8 +81,7 @@ inline bool AtomicDexRefMap<DexFileReferenceType, Value>::Remove(const DexFileRe
if (array == nullptr) {
return false;
}
- *out = (*array)[ref.index].load(std::memory_order_relaxed);
- (*array)[ref.index].store(nullptr, std::memory_order_seq_cst);
+ *out = (*array)[ref.index].exchange(nullptr, std::memory_order_seq_cst);
return true;
}