Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: third_party/protobuf/src/google/protobuf/arena.h

Issue 2759423004: Protobuf: Move thread-local global data to globals.cc (Closed)
Patch Set: Update patch file Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/arena.h
diff --git a/third_party/protobuf/src/google/protobuf/arena.h b/third_party/protobuf/src/google/protobuf/arena.h
index 72d8a9d9896320263084b0e4020e944f74f39764..2836a6183048c25a74de9806aeedc5e18db1d8d0 100644
--- a/third_party/protobuf/src/google/protobuf/arena.h
+++ b/third_party/protobuf/src/google/protobuf/arena.h
@@ -559,14 +559,16 @@ class LIBPROTOBUF_EXPORT Arena {
// Android ndk does not support GOOGLE_THREAD_LOCAL keyword so we use a custom thread
// local storage class we implemented.
// iOS also does not support the GOOGLE_THREAD_LOCAL keyword.
- static ThreadCache& thread_cache();
+ static ThreadCache& cr_thread_cache();
#elif defined(PROTOBUF_USE_DLLS)
// Thread local variables cannot be exposed through DLL interface but we can
// wrap them in static functions.
- static ThreadCache& thread_cache();
+ static ThreadCache& cr_thread_cache();
#else
static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_;
- static ThreadCache& thread_cache() { return thread_cache_; }
+ static ThreadCache& cr_thread_cache() {
+ return thread_cache_;
+ }
#endif
// SFINAE for skipping addition to delete list for a message type when created
@@ -874,8 +876,8 @@ class LIBPROTOBUF_EXPORT Arena {
uint64 ResetInternal();
inline void SetThreadCacheBlock(Block* block) {
- thread_cache().last_block_used_ = block;
- thread_cache().last_lifecycle_id_seen = lifecycle_id_;
+ cr_thread_cache().last_block_used_ = block;
+ cr_thread_cache().last_lifecycle_id_seen = lifecycle_id_;
}
int64 lifecycle_id_; // Unique for each arena. Changes on Reset().

Powered by Google App Engine
This is Rietveld 408576698