diff --git a/src/ds/helpers.h b/src/ds/helpers.h index 4ba019b..49211a3 100644 --- a/src/ds/helpers.h +++ b/src/ds/helpers.h @@ -219,6 +219,21 @@ namespace snmalloc { return this->ref().compare_exchange_strong(exp, des, mo); } + + SNMALLOC_FAST_PATH T + exchange(T des, std::memory_order mo = std::memory_order_seq_cst) noexcept + { + return this->ref().exchange(des, mo); + } + + template + SNMALLOC_FAST_PATH + typename std::enable_if::value, Q>::type + fetch_add( + Q arg, std::memory_order mo = std::memory_order_seq_cst) noexcept + { + return this->ref().fetch_add(arg, mo); + } }; static_assert(sizeof(TrivialInitAtomic) == sizeof(char));