dtoolbase: More elegant fix for NeverFreeMemory memory leak

Better fix for 74983d19a41d5fbf006cb269d6b1adc9f705dc99 is to just switch to an std::multimap.  This couldn't go in the 1.10.x branch due to the risk of ABI change.
This commit is contained in:
rdb 2020-12-20 00:39:24 +01:00
parent dee8df9427
commit ae3d8c2663
2 changed files with 2 additions and 6 deletions

View File

@ -80,11 +80,7 @@ Page(void *start, size_t size) :
*/
INLINE bool NeverFreeMemory::Page::
operator < (const NeverFreeMemory::Page &other) const {
if (_remaining != other._remaining) {
return _remaining < other._remaining;
} else {
return _next < other._next;
}
return _remaining < other._remaining;
}
/**

View File

@ -57,7 +57,7 @@ private:
size_t _remaining;
};
typedef std::set<Page> Pages;
typedef std::multiset<Page> Pages;
Pages _pages;
size_t _total_alloc;