mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 19:23:41 +02:00
depgraph: add memory usage control (feature)
Co-Authored-By: Lőrinc <pap.lorinc@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <memusage.h>
|
||||
#include <random.h>
|
||||
#include <span.h>
|
||||
#include <util/feefrac.h>
|
||||
@@ -332,6 +333,17 @@ public:
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Reduce memory usage if possible. No observable effect. */
|
||||
void Compact() noexcept
|
||||
{
|
||||
entries.shrink_to_fit();
|
||||
}
|
||||
|
||||
size_t DynamicMemoryUsage() const noexcept
|
||||
{
|
||||
return memusage::DynamicUsage(entries);
|
||||
}
|
||||
};
|
||||
|
||||
/** A set of transactions together with their aggregate feerate. */
|
||||
|
||||
Reference in New Issue
Block a user