Commit 6e79f1e9 authored by Benoit Lize's avatar Benoit Lize Committed by Commit Bot

[PartitionAlloc] Fix and unify alignment requirements for the root.

The alignment directives were not unified across platforms, and didn't
compile on Linux (due to a missing semicolon). Use "alignas()"
everywhere, which is also semantically closer to what we want.

Bug: 1141752
Change-Id: I3553932ac3a0fdeee989eba4b8eae83ffa281098
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2498466Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820809}
parent 3c05ab35
......@@ -36,13 +36,8 @@ namespace {
std::atomic<bool> g_initialization_lock;
std::atomic<base::ThreadSafePartitionRoot*> g_root_;
// Buffer for placement new.
#if defined(OS_WIN)
__declspec(align(base::kAlignment)) uint8_t
alignas(base::ThreadSafePartitionRoot) uint8_t
g_allocator_buffer[sizeof(base::ThreadSafePartitionRoot)];
#else
uint8_t g_allocator_buffer[sizeof(base::ThreadSafePartitionRoot)]
__attribute__((aligned(base::kAlignment)))
#endif
base::ThreadSafePartitionRoot* Allocator() {
// Double-checked locking.
......
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