Limit returned MBOSnapshot size to avoid memory leaking
This commit is contained in:
1 parent
34401960f9
commit
f65f34c2fe
1 file changed
+7
@@ -41,6 +41,13 @@ struct MBOSnapshot {
|
||||
|
||||
void reset() {
|
||||
updated = utils::TimeStamp();
|
||||
constexpr int max = 256;
|
||||
if (bids.size() > max) {
|
||||
bids.resize(max);
|
||||
}
|
||||
if (asks.size() > max) {
|
||||
asks.resize(max);
|
||||
}
|
||||
bids.clear();
|
||||
asks.clear();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user