diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-12-09 17:05:10 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-12-09 17:05:10 -0800 |
commit | 8d5d7cc6d03b00fcb7162525100fbd4cc0d1929d (patch) | |
tree | 8539b1dce0ae68029b7d74911acaec0ebad353e6 /src/google/protobuf/arena.h | |
parent | 496d47c27fd4301411156ebf108188b810f4e902 (diff) | |
download | protobuf-8d5d7cc6d03b00fcb7162525100fbd4cc0d1929d.tar.gz protobuf-8d5d7cc6d03b00fcb7162525100fbd4cc0d1929d.tar.bz2 protobuf-8d5d7cc6d03b00fcb7162525100fbd4cc0d1929d.zip |
Fix LIBPROTOBUF_PROTOBUF annotations for buliding protobuf as DLLs.v3.0.0-alpha-1
Diffstat (limited to 'src/google/protobuf/arena.h')
-rw-r--r-- | src/google/protobuf/arena.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index b5822bdb..d0cb163c 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -312,7 +312,12 @@ class LIBPROTOBUF_EXPORT Arena { static const size_t kHeaderSize = sizeof(Block); static google::protobuf::internal::SequenceNumber lifecycle_id_generator_; +#ifdef PROTOBUF_USE_DLLS + static ThreadCache& thread_cache(); +#else static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_; + static ThreadCache& thread_cache() { return thread_cache_; } +#endif // SFINAE for skipping addition to delete list for a Type. This is mainly to // skip proto2/proto1 message objects with cc_enable_arenas=true from being @@ -434,8 +439,8 @@ class LIBPROTOBUF_EXPORT Arena { void CleanupList(); inline void SetThreadCacheBlock(Block* block) { - thread_cache_.last_block_used_ = block; - thread_cache_.last_lifecycle_id_seen = lifecycle_id_; + thread_cache().last_block_used_ = block; + thread_cache().last_lifecycle_id_seen = lifecycle_id_; } int64 lifecycle_id_; // Unique for each arena. Changes on Reset(). |