addRef memory model too restrictive

Former-commit-id: 249e0fdd363853ab7b489314002bdacd2438fa55
This commit is contained in:
John Sully 2020-02-01 21:52:17 -05:00
parent 8ea5d731ad
commit ae0a3e9f65

View File

@ -784,8 +784,8 @@ public:
void setrefcount(unsigned ref);
unsigned getrefcount(std::memory_order order) const { return (refcount.load(order) & ~(1U << 31)); }
void addref() const { refcount.fetch_add(1, std::memory_order_acq_rel); }
unsigned release() const { return refcount.fetch_sub(1, std::memory_order_acq_rel) & ~(1U << 31); }
void addref() const { refcount.fetch_add(1, std::memory_order_relaxed); }
unsigned release() const { return refcount.fetch_sub(1, std::memory_order_relaxed) & ~(1U << 31); }
} robj;
static_assert(sizeof(redisObject) == 24, "object size is critical, don't increase");