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

Unified Diff: third_party/protobuf/src/google/protobuf/globals.cc

Issue 2759423004: Protobuf: Move thread-local global data to globals.cc (Closed)
Patch Set: Address pkasting@'s comments 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
« no previous file with comments | « third_party/protobuf/src/google/protobuf/arena.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/src/google/protobuf/globals.cc
diff --git a/third_party/protobuf/src/google/protobuf/globals.cc b/third_party/protobuf/src/google/protobuf/globals.cc
index f41227343c10d5402e922a88bd80f92377342fa6..31fb6ba912cd72d51e13e4bd3df451ea725747d8 100644
--- a/third_party/protobuf/src/google/protobuf/globals.cc
+++ b/third_party/protobuf/src/google/protobuf/globals.cc
@@ -28,6 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <google/protobuf/arena.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/stubs/atomicops.h>
@@ -35,6 +36,14 @@
namespace google {
namespace protobuf {
+
+#if !defined(GOOGLE_PROTOBUF_NO_THREADLOCAL) && defined(PROTOBUF_USE_DLLS)
+Arena::ThreadCache& Arena::cr_thread_cache() {
+ static GOOGLE_THREAD_LOCAL ThreadCache cr_thread_cache_ = {-1, NULL};
+ return cr_thread_cache_;
+}
+#endif
+
namespace internal {
SequenceNumber cr_lifecycle_id_generator_;
« no previous file with comments | « third_party/protobuf/src/google/protobuf/arena.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698