зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1447308 - Fix LifoAlloc::isEmpty() check r=nbp
This commit is contained in:
Родитель
1d25717185
Коммит
f0fd915638
|
@ -724,13 +724,14 @@ class LifoAlloc
|
|||
|
||||
// Return true if the LifoAlloc does not currently contain any allocations.
|
||||
bool isEmpty() const {
|
||||
return chunks_.empty() || !chunks_.last()->empty();
|
||||
return chunks_.empty() ||
|
||||
(chunks_.begin() == chunks_.last() && chunks_.last()->empty());
|
||||
}
|
||||
|
||||
// Return the number of bytes remaining to allocate in the current chunk.
|
||||
// e.g. How many bytes we can allocate before needing a new block.
|
||||
size_t availableInCurrentChunk() const {
|
||||
if (!chunks_.empty())
|
||||
if (chunks_.empty())
|
||||
return 0;
|
||||
return chunks_.last()->unused();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче