/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#pragma once
-#include <assert.h>
+#include <folly/lang/SafeAssert.h>
+
#include <stdint.h>
namespace folly {
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;
}