Commit be4abcd9 authored by Xiao Shi's avatar Xiao Shi Committed by Facebook Github Bot

StampedPtr: use async-signal-safe assert

Summary: Use SafeAssert instead of assert.

Reviewed By: nbronson

Differential Revision: D5085575

fbshipit-source-id: daeff427b9b1fc5dff6ea986d16a70364acd2dd7
parent c75c575b
......@@ -16,7 +16,8 @@
#pragma once
#include <assert.h>
#include <folly/SafeAssert.h>
#include <stdint.h>
namespace folly {
......@@ -106,8 +107,8 @@ struct StampedPtr {
auto shifted = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(ptr))
<< kInternalStampBits;
uint64_t raw = shifted | stamp;
assert(unpackPtr(raw) == ptr);
assert(unpackStamp(raw) == stamp);
FOLLY_SAFE_DCHECK(unpackPtr(raw) == ptr, "ptr mismatch.");
FOLLY_SAFE_DCHECK(unpackStamp(raw) == stamp, "stamp mismatch.");
return raw;
}
......
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