Commit cb52b05e by Abseil Team Committed by Derek Mauro

Export of internal Abseil changes

--
adcea274552c5671bdafae7f85797c49c9639b67 by Abseil Team <absl-team@google.com>:

change some const declarations to constexpr

PiperOrigin-RevId: 307516528

--
f828d23bdd437f38ae52ba232fd44c477643ddaf by Derek Mauro <dmauro@google.com>:

Use "-lrt" instead of the resolved find_library result when linking
librt. find_library defaults to shared objects. Imports #665.

PiperOrigin-RevId: 307465639
GitOrigin-RevId: adcea274552c5671bdafae7f85797c49c9639b67
Change-Id: I8f562ef8f57f5ed55192936c764fa6532e3b8adb
parent 1a02b7a2
...@@ -645,12 +645,12 @@ class Cord { ...@@ -645,12 +645,12 @@ class Cord {
// InlineRep holds either a tree pointer, or an array of kMaxInline bytes. // InlineRep holds either a tree pointer, or an array of kMaxInline bytes.
class InlineRep { class InlineRep {
public: public:
static const unsigned char kMaxInline = 15; static constexpr unsigned char kMaxInline = 15;
static_assert(kMaxInline >= sizeof(absl::cord_internal::CordRep*), ""); static_assert(kMaxInline >= sizeof(absl::cord_internal::CordRep*), "");
// Tag byte & kMaxInline means we are storing a pointer. // Tag byte & kMaxInline means we are storing a pointer.
static const unsigned char kTreeFlag = 1 << 4; static constexpr unsigned char kTreeFlag = 1 << 4;
// Tag byte & kProfiledFlag means we are profiling the Cord. // Tag byte & kProfiledFlag means we are profiling the Cord.
static const unsigned char kProfiledFlag = 1 << 5; static constexpr unsigned char kProfiledFlag = 1 << 5;
constexpr InlineRep() : data_{} {} constexpr InlineRep() : data_{} {}
InlineRep(const InlineRep& src); InlineRep(const InlineRep& src);
......
...@@ -101,7 +101,7 @@ class Waiter { ...@@ -101,7 +101,7 @@ class Waiter {
// How many periods to remain idle before releasing resources // How many periods to remain idle before releasing resources
#ifndef THREAD_SANITIZER #ifndef THREAD_SANITIZER
static const int kIdlePeriods = 60; static constexpr int kIdlePeriods = 60;
#else #else
// Memory consumption under ThreadSanitizer is a serious concern, // Memory consumption under ThreadSanitizer is a serious concern,
// so we release resources sooner. The value of 1 leads to 1 to 2 second // so we release resources sooner. The value of 1 leads to 1 to 2 second
......
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