From 685f2dd9eacc456f64b7e91498a07ba9c5e1de91 Mon Sep 17 00:00:00 2001 From: Evan Brown Date: Tue, 19 Nov 2024 09:00:55 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 698037030 --- .../Reflection/FeatureSetDescriptor.g.cs | 17 ----------------- .../lazy_extensions_ablation_experiment.cc | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs create mode 100644 src/google/protobuf/lazy_extensions_ablation_experiment.cc diff --git a/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs b/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs deleted file mode 100644 index 208ce1fcb6..0000000000 --- a/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd -#endregion - -namespace Google.Protobuf.Reflection; - -internal sealed partial class FeatureSetDescriptor -{ - // Canonical serialized form of the edition defaults, generated by embed_edition_defaults. - private const string DefaultsBase64 = - "ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH"; -} diff --git a/src/google/protobuf/lazy_extensions_ablation_experiment.cc b/src/google/protobuf/lazy_extensions_ablation_experiment.cc new file mode 100644 index 0000000000..73104825e3 --- /dev/null +++ b/src/google/protobuf/lazy_extensions_ablation_experiment.cc @@ -0,0 +1,19 @@ +#include "third_party/tcmalloc/experiment.h" +#include "third_party/tcmalloc/experiment_config.h" + +namespace google { +namespace protobuf { +namespace internal { + +// We provide this function because protobuf can't always depend directly on +// TCMalloc experiment framework. This will be linked into binaries that use +// TCMalloc and we can define a weak version of this function that always +// returns false for cases in which TCMalloc is not used. +bool IsLazyExtensionsAblationExperimentActive() { + return tcmalloc::IsExperimentActive( + tcmalloc::Experiment::PROTOBUF_LAZY_EXTENSION_ABLATION); +} + +} // namespace internal +} // namespace protobuf +} // namespace google