about summary refs log tree commit diff
path: root/absl/flags/internal/commandlineflag.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-09-06T09·25-0700
committerGennadiy Rozental <rogeeff@google.com>2019-09-06T11·28-0400
commit325fd7b042ff4ec34f7dd32e602cd81ad0e24b22 (patch)
tree8abf822f0f1fc3cbaaca59f8dc9969f394761410 /absl/flags/internal/commandlineflag.h
parent83c1d65c90a92aa49632b9ac5a793214bb0768bc (diff)
Export of internal Abseil changes
--
2e894f3c2fadc789abf9011222526d5da1e0433e by Gennadiy Rozental <rogeeff@google.com>:

Internal change

PiperOrigin-RevId: 267557172

--
535be36d401a556156223ecc1aabd73a271f0f05 by Abseil Team <absl-team@google.com>:

Internal change.

PiperOrigin-RevId: 267456795
GitOrigin-RevId: 2e894f3c2fadc789abf9011222526d5da1e0433e
Change-Id: I95d29cbde5cd8342ae71b77728baa61b7cf6d440
Diffstat (limited to 'absl/flags/internal/commandlineflag.h')
-rw-r--r--absl/flags/internal/commandlineflag.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/absl/flags/internal/commandlineflag.h b/absl/flags/internal/commandlineflag.h
index 572568b93711..284286b6be18 100644
--- a/absl/flags/internal/commandlineflag.h
+++ b/absl/flags/internal/commandlineflag.h
@@ -207,7 +207,6 @@ class CommandLineFlag {
         def_(def),
         cur_(cur),
         counter_(0),
-        atomic_(kAtomicInit),
         locks_(nullptr) {}
 
   // Virtual destructor
@@ -235,6 +234,10 @@ class CommandLineFlag {
   std::string DefaultValue() const;
   std::string CurrentValue() const;
 
+  // Interface to store the value in atomic if one used. This is short term
+  // interface. To be reworked once cur_ is moved.
+  virtual void StoreAtomic() {}
+
   // Interfaces to operate on validators.
   virtual bool HasValidatorFn() const { return false; }
   virtual bool InvokeValidator(const void* /*value*/) const { return true; }
@@ -276,8 +279,6 @@ class CommandLineFlag {
                      flags_internal::FlagSettingMode set_mode,
                      flags_internal::ValueSource source, std::string* error);
 
-  void StoreAtomic(size_t size);
-
   void CheckDefaultValueParsingRoundtrip() const;
 
   // Constant configuration for a particular flag.
@@ -300,11 +301,6 @@ class CommandLineFlag {
   void* cur_;             // Lazily initialized pointer to current value
   int64_t counter_;         // Mutation counter
 
-  // For some types, a copy of the current value is kept in an atomically
-  // accessible field.
-  static const int64_t kAtomicInit = 0xababababababababll;
-  std::atomic<int64_t> atomic_;
-
   // Lazily initialized mutexes for this flag value.  We cannot inline a
   // SpinLock or Mutex here because those have non-constexpr constructors and
   // so would prevent constant initialization of this type.