mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
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:
parent
dee8df9427
commit
ae3d8c2663
@ -80,11 +80,7 @@ Page(void *start, size_t size) :
|
|||||||
*/
|
*/
|
||||||
INLINE bool NeverFreeMemory::Page::
|
INLINE bool NeverFreeMemory::Page::
|
||||||
operator < (const NeverFreeMemory::Page &other) const {
|
operator < (const NeverFreeMemory::Page &other) const {
|
||||||
if (_remaining != other._remaining) {
|
return _remaining < other._remaining;
|
||||||
return _remaining < other._remaining;
|
|
||||||
} else {
|
|
||||||
return _next < other._next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +57,7 @@ private:
|
|||||||
size_t _remaining;
|
size_t _remaining;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::set<Page> Pages;
|
typedef std::multiset<Page> Pages;
|
||||||
Pages _pages;
|
Pages _pages;
|
||||||
|
|
||||||
size_t _total_alloc;
|
size_t _total_alloc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user