diff --git a/Builds/VisualStudio2015/RippleD.vcxproj b/Builds/VisualStudio2015/RippleD.vcxproj
index 4c0c2c9aa..b512202ed 100644
--- a/Builds/VisualStudio2015/RippleD.vcxproj
+++ b/Builds/VisualStudio2015/RippleD.vcxproj
@@ -1956,6 +1956,8 @@
+
+
@@ -3965,8 +3967,6 @@
True
True
-
-
diff --git a/Builds/VisualStudio2015/RippleD.vcxproj.filters b/Builds/VisualStudio2015/RippleD.vcxproj.filters
index 3680883f6..fab7841dd 100644
--- a/Builds/VisualStudio2015/RippleD.vcxproj.filters
+++ b/Builds/VisualStudio2015/RippleD.vcxproj.filters
@@ -2685,6 +2685,9 @@
ripple\basics
+
+ ripple\basics
+
ripple\basics
@@ -4593,9 +4596,6 @@
ripple\unl\tests
-
- ripple\unl\tests
-
ripple\unl\tests
diff --git a/src/ripple/unl/tests/qalloc.h b/src/ripple/basics/qalloc.h
similarity index 77%
rename from src/ripple/unl/tests/qalloc.h
rename to src/ripple/basics/qalloc.h
index 29efe0ec5..bb2be4498 100644
--- a/src/ripple/unl/tests/qalloc.h
+++ b/src/ripple/basics/qalloc.h
@@ -17,8 +17,8 @@
*/
//==============================================================================
-#ifndef RIPPLE_SIM_QALLOC_H_INCLUDED
-#define RIPPLE_SIM_QALLOC_H_INCLUDED
+#ifndef RIPPLE_BASICS_QALLOC_H_INCLUDED
+#define RIPPLE_BASICS_QALLOC_H_INCLUDED
#include
#include
@@ -29,9 +29,9 @@
#include
#include
#include
+#include
namespace ripple {
-namespace test {
namespace detail {
@@ -87,11 +87,11 @@ public:
} // detail
-template
+template
class qalloc_type
{
private:
- template
+ template
friend class qalloc_type;
std::shared_ptr<
@@ -105,22 +105,24 @@ public:
std::add_lvalue_reference::type;
using const_reference = typename
std::add_lvalue_reference::type;
+ using propagate_on_container_move_assignment =
+ std::true_type;
template
struct rebind
{
- using other = qalloc_type;
+ using other = qalloc_type;
};
qalloc_type (qalloc_type const&) = default;
- qalloc_type& operator= (qalloc_type const&) = default;
qalloc_type (qalloc_type&& other) = default;
+ qalloc_type& operator= (qalloc_type const&) = default;
qalloc_type& operator= (qalloc_type&&) = default;
qalloc_type();
template
- qalloc_type (qalloc_type const& u);
+ qalloc_type (qalloc_type const& u);
template
U*
@@ -136,16 +138,23 @@ public:
void
deallocate (T* p, std::size_t n);
- void
- destroy (T* t);
+ template
+ bool
+ operator== (qalloc_type const& u);
template
bool
- operator== (qalloc_type const& u);
+ operator!= (qalloc_type const& u);
- template
- bool
- operator!= (qalloc_type const& u);
+ qalloc_type
+ select_on_container_copy_construction() const;
+
+private:
+ qalloc_type
+ select_on_copy(std::true_type) const;
+
+ qalloc_type
+ select_on_copy(std::false_type) const;
};
/** Allocator optimized for delete in temporal order.
@@ -158,7 +167,7 @@ public:
May not be called concurrently.
*/
-using qalloc = qalloc_type;
+using qalloc = qalloc_type;
//------------------------------------------------------------------------------
@@ -292,25 +301,25 @@ qalloc_impl<_>::deallocate (void* p)
//------------------------------------------------------------------------------
-template
-qalloc_type::qalloc_type()
+template
+qalloc_type::qalloc_type()
: impl_ (std::make_shared<
detail::qalloc_impl<>>())
{
}
-template
+template
template
-qalloc_type::qalloc_type(
- qalloc_type const& u)
+qalloc_type::qalloc_type(
+ qalloc_type const& u)
: impl_ (u.impl_)
{
}
-template
+template
template
U*
-qalloc_type::alloc (std::size_t n)
+qalloc_type::alloc (std::size_t n)
{
if (n > std::numeric_limits<
std::size_t>::max() / sizeof(U))
@@ -321,61 +330,77 @@ qalloc_type::alloc (std::size_t n)
std::alignment_of::value));
}
-template
+template
template
inline
void
-qalloc_type::dealloc(
+qalloc_type::dealloc(
U* p, std::size_t n)
{
impl_->deallocate(p);
}
-template
+template
T*
-qalloc_type::allocate (std::size_t n)
+qalloc_type::allocate (std::size_t n)
{
return alloc(n);
}
-template
+template
inline
void
-qalloc_type::deallocate(
+qalloc_type::deallocate(
T* p, std::size_t n)
{
dealloc(p, n);
}
-template
-inline
-void
-qalloc_type::destroy (T* t)
-{
- t->~T();
-}
-
-template
+template
template
inline
bool
-qalloc_type::operator==(
- qalloc_type const& u)
+qalloc_type::operator==(
+ qalloc_type const& u)
{
return impl_.get() == u.impl_.get();
}
-template
+template
template
inline
bool
-qalloc_type::operator!=(
- qalloc_type const& u)
+qalloc_type::operator!=(
+ qalloc_type const& u)
{
return ! (*this == u);
}
-} // test
+template
+auto
+qalloc_type::select_on_container_copy_construction() const ->
+ qalloc_type
+{
+ return select_on_copy(
+ std::integral_constant{});
+}
+
+template
+auto
+qalloc_type::select_on_copy(std::true_type) const ->
+ qalloc_type
+{
+ return *this; // shared arena
+}
+
+template
+auto
+qalloc_type::select_on_copy(std::false_type) const ->
+ qalloc_type
+{
+ return {}; // new arena
+}
+
} // ripple
#endif
diff --git a/src/ripple/ledger/OpenView.h b/src/ripple/ledger/OpenView.h
index 4865a3820..ce9f4fc3a 100644
--- a/src/ripple/ledger/OpenView.h
+++ b/src/ripple/ledger/OpenView.h
@@ -23,7 +23,10 @@
#include
#include
#include
+#include
#include
+#include
+#include
namespace ripple {
@@ -51,9 +54,11 @@ private:
// List of tx, key order
using txs_map = std::map, std::shared_ptr<
- Serializer const>>>;
+ std::pair,
+ std::shared_ptr>,
+ std::less, qalloc_type,
+ std::shared_ptr>>, false>>;
Rules rules_;
txs_map txs_;
diff --git a/src/ripple/ledger/detail/RawStateTable.h b/src/ripple/ledger/detail/RawStateTable.h
index 973e19e25..651b6b60c 100644
--- a/src/ripple/ledger/detail/RawStateTable.h
+++ b/src/ripple/ledger/detail/RawStateTable.h
@@ -22,6 +22,7 @@
#include
#include
+#include
#include