diff options
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/support/debug_location.h | 1 | ||||
-rw-r--r-- | src/core/lib/support/reference_counted.cc | 4 | ||||
-rw-r--r-- | src/core/lib/support/reference_counted.h | 2 | ||||
-rw-r--r-- | src/core/lib/support/reference_counted_ptr.h | 8 |
4 files changed, 6 insertions, 9 deletions
diff --git a/src/core/lib/support/debug_location.h b/src/core/lib/support/debug_location.h index 0095941ce3..47c5082874 100644 --- a/src/core/lib/support/debug_location.h +++ b/src/core/lib/support/debug_location.h @@ -28,6 +28,7 @@ class DebugLocation { bool Log() const { return true; } const char* file() const { return file_; } int line() const { return line_; } + private: const char* file_; const int line_; diff --git a/src/core/lib/support/reference_counted.cc b/src/core/lib/support/reference_counted.cc index 84ede18efe..222628a6fa 100644 --- a/src/core/lib/support/reference_counted.cc +++ b/src/core/lib/support/reference_counted.cc @@ -34,9 +34,7 @@ void ReferenceCounted::Ref(const DebugLocation& location, const char* reason) { Ref(); } -void ReferenceCounted::Ref() { - gpr_ref(&refs_); -} +void ReferenceCounted::Ref() { gpr_ref(&refs_); } bool ReferenceCounted::Unref(const DebugLocation& location, const char* reason) { diff --git a/src/core/lib/support/reference_counted.h b/src/core/lib/support/reference_counted.h index 0076aa562c..42bedcbd3a 100644 --- a/src/core/lib/support/reference_counted.h +++ b/src/core/lib/support/reference_counted.h @@ -40,7 +40,7 @@ class ReferenceCounted { protected: // Allow Delete() to access destructor. - template<typename T> + template <typename T> friend void Delete(T*); explicit ReferenceCounted(TraceFlag* trace_flag) : trace_flag_(trace_flag) { diff --git a/src/core/lib/support/reference_counted_ptr.h b/src/core/lib/support/reference_counted_ptr.h index e4599a5965..3782380943 100644 --- a/src/core/lib/support/reference_counted_ptr.h +++ b/src/core/lib/support/reference_counted_ptr.h @@ -27,15 +27,13 @@ namespace grpc_core { // A smart pointer class for objects that provide Ref() and Unref() methods, // such as those provided by the ReferenceCounted base class. -template<typename T> +template <typename T> class ReferenceCountedPtr { public: ReferenceCountedPtr() {} // If value is non-null, we take ownership of a ref to it. - explicit ReferenceCountedPtr(T* value) { - value_ = value; - } + explicit ReferenceCountedPtr(T* value) { value_ = value; } // Move support. ReferenceCountedPtr(ReferenceCountedPtr&& other) { @@ -80,7 +78,7 @@ class ReferenceCountedPtr { T* value_ = nullptr; }; -template<typename T, typename... Args> +template <typename T, typename... Args> inline ReferenceCountedPtr<T> MakeReferenceCounted(Args&&... args) { return ReferenceCountedPtr<T>(New<T>(std::forward<Args>(args)...)); } |