mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
Avoid excessive resizing.
This commit is contained in:
@@ -309,6 +309,7 @@ void ValidationCollection::doWrite(Job&)
|
||||
while (!mStaleValidations.empty())
|
||||
{
|
||||
std::vector<SerializedValidation::pointer> vector;
|
||||
vector.reserve(512);
|
||||
mStaleValidations.swap(vector);
|
||||
sl.unlock();
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ class ValidationCollection
|
||||
{
|
||||
protected:
|
||||
|
||||
boost::mutex mValidationLock;
|
||||
boost::mutex mValidationLock;
|
||||
TaggedCache<uint256, ValidationSet> mValidations;
|
||||
boost::unordered_map<uint160, SerializedValidation::pointer> mCurrentValidations;
|
||||
std::vector<SerializedValidation::pointer> mStaleValidations;
|
||||
@@ -34,7 +34,8 @@ protected:
|
||||
boost::shared_ptr<ValidationSet> findSet(const uint256& ledgerHash);
|
||||
|
||||
public:
|
||||
ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false) { ; }
|
||||
ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false)
|
||||
{ mStaleValidations.reserve(512); }
|
||||
|
||||
bool addValidation(SerializedValidation::ref);
|
||||
ValidationSet getValidations(const uint256& ledger);
|
||||
|
||||
Reference in New Issue
Block a user