diff libinterp/octave-value/ov-base.h @ 30139:c789e728d57a

Backed out changeset 938794bc82b7 Renaming octave_base_value::count to m_count breaks some packages that define new octave_value data types. Maybe those packages shouldn't be touching the count directly, but they do. Since we may also want to switch to using std::shared_ptr to manage octave_value objects instead of our own custom reference counting implmentation, it is probably best to delay this change until we know exactly what path we want to take.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Sep 2021 11:14:44 -0400
parents 938794bc82b7
children 870687a59e96
line wrap: on
line diff
--- a/libinterp/octave-value/ov-base.h	Wed Sep 08 06:46:19 2021 -0400
+++ b/libinterp/octave-value/ov-base.h	Wed Sep 08 11:14:44 2021 -0400
@@ -254,9 +254,9 @@
 
   friend class octave_value;
 
-  octave_base_value (void) : m_count (1) { }
+  octave_base_value (void) : count (1) { }
 
-  octave_base_value (const octave_base_value&) : m_count (1) { }
+  octave_base_value (const octave_base_value&) : count (1) { }
 
   virtual ~octave_base_value (void) = default;
 
@@ -274,8 +274,7 @@
   virtual octave_base_value *
   unique_clone (void) { return clone (); }
 
-  virtual void break_closure_cycles (const std::shared_ptr<octave::stack_frame>&)
-  { }
+  virtual void break_closure_cycles (const std::shared_ptr<octave::stack_frame>&) { }
 
   virtual type_conv_info
   numeric_conversion_function (void) const
@@ -302,8 +301,7 @@
   virtual octave_value as_uint32 (void) const;
   virtual octave_value as_uint64 (void) const;
 
-  virtual octave_base_value * try_narrowing_conversion (void)
-  { return nullptr; }
+  virtual octave_base_value * try_narrowing_conversion (void) { return nullptr; }
 
   virtual void maybe_economize (void) { }
 
@@ -892,25 +890,21 @@
 
   OCTINTERP_API void reset (void) const;
 
+  // A reference count.
+  // NOTE: the declaration is octave_idx_type because with 64-bit indexing,
+  // it is well possible to have more than MAX_INT copies of a single value
+  // (think of an empty cell array with >2G elements).
+  octave::refcount<octave_idx_type> count;
+
   OCTINTERP_API static const char * get_umap_name (unary_mapper_t);
 
   OCTINTERP_API void warn_load (const char *type) const;
   OCTINTERP_API void warn_save (const char *type) const;
 
-  //--------
-
-  // A reference count.
-  // NOTE: the declaration is octave_idx_type because with 64-bit indexing,
-  // it is well possible to have more than MAX_INT copies of a single value
-  // (think of an empty cell array with >2G elements).
-  octave::refcount<octave_idx_type> m_count;
-
 private:
 
   OCTINTERP_API void wrong_type_arg_error (void) const;
 
-  //--------
-
   static int curr_print_indent_level;
   static bool beginning_of_line;