folly/fibers/test/FibersTest.cpp: accommodate ASAN's detect_stack_use_after_return=1
[folly.git] / folly / experimental / ReadMostlySharedPtr.h
index 9e3a5d0a75f5b2823bf33eff5664956abe6b046b..f80fdde1e1aec9e47c25626e5d986ec1cfc71c33 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ class ReadMostlySharedPtrCore {
   std::shared_ptr<T> ptr_;
 };
 
-}
+} // namespace detail
 
 template <typename T, typename RefCount = DefaultRefCount>
 class ReadMostlyMainPtr {
@@ -159,9 +159,9 @@ class ReadMostlyMainPtr {
     }
   }
 
-  std::shared_ptr<T> getStdShared() {
+  std::shared_ptr<T> getStdShared() const {
     if (impl_) {
-      return impl_->ptr_;
+      return impl_->getShared();
     } else {
       return {};
     }
@@ -320,7 +320,7 @@ class ReadMostlySharedPtr {
 
   std::shared_ptr<T> getStdShared() const {
     if (impl_) {
-      return impl_->ptr_;
+      return impl_->getShared();
     } else {
       return {};
     }
@@ -451,4 +451,4 @@ inline bool operator!=(
     const ReadMostlySharedPtr<T, RefCount>& ptr) {
   return !(ptr == nullptr);
 }
-}
+} // namespace folly