Commit 071b632b authored by Pranjal Raihan's avatar Pranjal Raihan Committed by Facebook GitHub Bot

Use FOLLY_DISABLE_SANITIZERS in MicroLock

Reviewed By: yfeldblum

Differential Revision: D32364716

fbshipit-source-id: f36356d5818adebe5bbbe219044c81282ab008a6
parent 92c5f79b
...@@ -155,14 +155,14 @@ class MicroLockCore { ...@@ -155,14 +155,14 @@ class MicroLockCore {
} }
template <typename Func> template <typename Func>
FOLLY_DISABLE_ADDRESS_SANITIZER FOLLY_DISABLE_MEMORY_SANITIZER void FOLLY_DISABLE_SANITIZERS void unlockAndStoreWithModifier(
unlockAndStoreWithModifier(Func modifier) noexcept; Func modifier) noexcept;
public: public:
/** /**
* Loads the data stored in the unused bits of the lock atomically. * Loads the data stored in the unused bits of the lock atomically.
*/ */
FOLLY_DISABLE_ADDRESS_SANITIZER FOLLY_DISABLE_MEMORY_SANITIZER uint8_t FOLLY_DISABLE_SANITIZERS uint8_t
load(std::memory_order order = std::memory_order_seq_cst) const noexcept { load(std::memory_order order = std::memory_order_seq_cst) const noexcept {
return decodeDataFromWord(word()->load(order)); return decodeDataFromWord(word()->load(order));
} }
...@@ -172,7 +172,7 @@ class MicroLockCore { ...@@ -172,7 +172,7 @@ class MicroLockCore {
* used by the lock, the most significant 2 bits of the provided value will be * used by the lock, the most significant 2 bits of the provided value will be
* ignored. * ignored.
*/ */
FOLLY_DISABLE_ADDRESS_SANITIZER FOLLY_DISABLE_MEMORY_SANITIZER void store( FOLLY_DISABLE_SANITIZERS void store(
uint8_t value, uint8_t value,
std::memory_order order = std::memory_order_seq_cst) noexcept; std::memory_order order = std::memory_order_seq_cst) noexcept;
...@@ -260,11 +260,9 @@ class MicroLockBase : public MicroLockCore { ...@@ -260,11 +260,9 @@ class MicroLockBase : public MicroLockCore {
* data, in which case reading and locking should be done in one atomic * data, in which case reading and locking should be done in one atomic
* operation. * operation.
*/ */
FOLLY_DISABLE_ADDRESS_SANITIZER FOLLY_DISABLE_MEMORY_SANITIZER uint8_t FOLLY_DISABLE_SANITIZERS uint8_t lockAndLoad() noexcept;
lockAndLoad() noexcept;
void lock() noexcept { lockAndLoad(); } void lock() noexcept { lockAndLoad(); }
FOLLY_DISABLE_ADDRESS_SANITIZER FOLLY_DISABLE_MEMORY_SANITIZER bool FOLLY_DISABLE_SANITIZERS bool try_lock() noexcept;
try_lock() noexcept;
/** /**
* A lock guard which allows reading and writing to the unused bits of the * A lock guard which allows reading and writing to the unused bits of the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment