aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2022-01-24 20:27:14 -0800
committerColin Cross <ccross@android.com>2022-04-12 12:11:06 -0700
commit36ccdba805f1322c23714dbeb227fb632b54ae45 (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
parentebc7d1eda6f23c4fa070f527fa557ba750fa30b0 (diff)
downloadwebrtc-36ccdba805f1322c23714dbeb227fb632b54ae45.tar.gz
Update webrtc's abseil-cpp
Copy external/abseil-cpp into webrtc to update to version 20211102.0 to pick up changes that fix compiling against musl libc. Bug: 190084016 Test: m USE_HOST_MUSL=true host-native Test: m checkbuild Change-Id: I0ab600cd8db93a55eda8358cdbecd21c2f78d8fb
Diffstat (limited to 'third_party/abseil-cpp/absl/random/internal/pool_urbg.cc')
-rw-r--r--third_party/abseil-cpp/absl/random/internal/pool_urbg.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc b/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
index 5bee530770..725100a415 100644
--- a/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
+++ b/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc
@@ -194,11 +194,10 @@ RandenPoolEntry* PoolAlignedAlloc() {
// Not all the platforms that we build for have std::aligned_alloc, however
// since we never free these objects, we can over allocate and munge the
// pointers to the correct alignment.
- void* memory = std::malloc(sizeof(RandenPoolEntry) + kAlignment);
- auto x = reinterpret_cast<intptr_t>(memory);
+ intptr_t x = reinterpret_cast<intptr_t>(
+ new char[sizeof(RandenPoolEntry) + kAlignment]);
auto y = x % kAlignment;
- void* aligned =
- (y == 0) ? memory : reinterpret_cast<void*>(x + kAlignment - y);
+ void* aligned = reinterpret_cast<void*>(y == 0 ? x : (x + kAlignment - y));
return new (aligned) RandenPoolEntry();
}