From 9bc751174866fdb762003568d7981b777e2cd607 Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Sat, 10 Dec 2022 15:25:08 -0800 Subject: [PATCH 1/2] place alignas() before lifetime specifiers --- src/google/protobuf/arena.cc | 2 +- src/google/protobuf/arena_impl.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index 8479f5dd0062..a98b288bf0c2 100644 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -441,7 +441,7 @@ ThreadSafeArena::SerialArenaChunk* ThreadSafeArena::SentrySerialArenaChunk() { } -ABSL_CONST_INIT alignas(kCacheAlignment) +alignas(kCacheAlignment) ABSL_CONST_INIT std::atomic ThreadSafeArena::lifecycle_id_{0}; #if defined(PROTOBUF_NO_THREADLOCAL) ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() { diff --git a/src/google/protobuf/arena_impl.h b/src/google/protobuf/arena_impl.h index a75f233a0f06..06fc11df4448 100644 --- a/src/google/protobuf/arena_impl.h +++ b/src/google/protobuf/arena_impl.h @@ -581,8 +581,8 @@ class PROTOBUF_EXPORT ThreadSafeArena { #pragma warning(disable : 4324) #endif using LifecycleId = uint64_t; - ABSL_CONST_INIT alignas( - kCacheAlignment) static std::atomic lifecycle_id_; + alignas(kCacheAlignment) ABSL_CONST_INIT static std::atomic + lifecycle_id_; #if defined(PROTOBUF_NO_THREADLOCAL) // iOS does not support __thread keyword so we use a custom thread local // storage class we implemented. From 146eef8ef1965b729e055ae3078251c23eaf9ea5 Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Tue, 13 Dec 2022 12:36:58 -0800 Subject: [PATCH 2/2] formatting --- src/google/protobuf/arena_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google/protobuf/arena_impl.h b/src/google/protobuf/arena_impl.h index 06fc11df4448..70b5f199d8ad 100644 --- a/src/google/protobuf/arena_impl.h +++ b/src/google/protobuf/arena_impl.h @@ -581,8 +581,8 @@ class PROTOBUF_EXPORT ThreadSafeArena { #pragma warning(disable : 4324) #endif using LifecycleId = uint64_t; - alignas(kCacheAlignment) ABSL_CONST_INIT static std::atomic - lifecycle_id_; + alignas(kCacheAlignment) ABSL_CONST_INIT + static std::atomic lifecycle_id_; #if defined(PROTOBUF_NO_THREADLOCAL) // iOS does not support __thread keyword so we use a custom thread local // storage class we implemented.