diff --git a/include/boost/json/impl/object.hpp b/include/boost/json/impl/object.hpp index a2d02ffc..d341a26f 100644 --- a/include/boost/json/impl/object.hpp +++ b/include/boost/json/impl/object.hpp @@ -80,8 +80,11 @@ struct object::element p[sizeof(element) + n + key.size()] = '\0'; boost::ignore_unused(e); +#if 0 + // VFALCO This causes unnecessary addref/release BOOST_ASSERT( *e->v_.get_storage() == *sp); +#endif return reinterpret_cast(p); } diff --git a/include/boost/json/impl/storage.ipp b/include/boost/json/impl/storage.ipp index 5ed74b4e..637e0bfe 100644 --- a/include/boost/json/impl/storage.ipp +++ b/include/boost/json/impl/storage.ipp @@ -12,26 +12,12 @@ #include #include -#include #include #include namespace boost { namespace json { -storage_ptr:: -~storage_ptr() -{ - if(p_) - p_->release(); -} - -storage_ptr:: -storage_ptr(storage_ptr&& other) noexcept - : p_(boost::exchange(other.p_, nullptr)) -{ -} - storage_ptr:: storage_ptr(storage_ptr const& other) noexcept : p_(other.p_) diff --git a/include/boost/json/storage.hpp b/include/boost/json/storage.hpp index 0523c439..fc5de171 100644 --- a/include/boost/json/storage.hpp +++ b/include/boost/json/storage.hpp @@ -11,6 +11,7 @@ #define BOOST_JSON_STORAGE_HPP #include +#include #include #include #include @@ -86,11 +87,17 @@ class storage_ptr public: storage_ptr() = default; - BOOST_JSON_DECL - ~storage_ptr(); + ~storage_ptr() + { + if(p_) + p_->release(); + } - BOOST_JSON_DECL - storage_ptr(storage_ptr&&) noexcept; + storage_ptr(storage_ptr&& other) noexcept + : p_(boost::exchange( + other.p_, nullptr)) + { + } BOOST_JSON_DECL storage_ptr(storage_ptr const&) noexcept;