зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1085701 - Report the allocation size to the OOM abort. r=roc
This commit is contained in:
Родитель
6a3800de71
Коммит
f2d23931c0
|
@ -1024,11 +1024,12 @@ nsDisplayListBuilder::MarkPreserve3DFramesForDisplayList(nsIFrame* aDirtyFrame,
|
|||
}
|
||||
|
||||
void*
|
||||
nsDisplayListBuilder::Allocate(size_t aSize) {
|
||||
nsDisplayListBuilder::Allocate(size_t aSize)
|
||||
{
|
||||
void *tmp;
|
||||
PL_ARENA_ALLOCATE(tmp, &mPool, aSize);
|
||||
if (!tmp) {
|
||||
NS_RUNTIMEABORT("out of memory");
|
||||
NS_ABORT_OOM(aSize);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ nsPresArena::Allocate(uint32_t aCode, size_t aSize)
|
|||
list->mEntriesEverAllocated++;
|
||||
PL_ARENA_ALLOCATE(result, &mPool, aSize);
|
||||
if (!result) {
|
||||
NS_RUNTIMEABORT("out of memory");
|
||||
NS_ABORT_OOM(aSize);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -360,9 +360,10 @@ nsLineLayout::NewPerSpanData()
|
|||
PerSpanData* psd = mSpanFreeList;
|
||||
if (!psd) {
|
||||
void *mem;
|
||||
PL_ARENA_ALLOCATE(mem, &mArena, sizeof(PerSpanData));
|
||||
size_t sz = sizeof(PerSpanData);
|
||||
PL_ARENA_ALLOCATE(mem, &mArena, sz);
|
||||
if (!mem) {
|
||||
NS_RUNTIMEABORT("OOM");
|
||||
NS_ABORT_OOM(sz);
|
||||
}
|
||||
psd = reinterpret_cast<PerSpanData*>(mem);
|
||||
}
|
||||
|
@ -583,9 +584,10 @@ nsLineLayout::NewPerFrameData(nsIFrame* aFrame)
|
|||
PerFrameData* pfd = mFrameFreeList;
|
||||
if (!pfd) {
|
||||
void *mem;
|
||||
PL_ARENA_ALLOCATE(mem, &mArena, sizeof(PerFrameData));
|
||||
size_t sz = sizeof(PerFrameData);
|
||||
PL_ARENA_ALLOCATE(mem, &mArena, sz);
|
||||
if (!mem) {
|
||||
NS_RUNTIMEABORT("OOM");
|
||||
NS_ABORT_OOM(sz);
|
||||
}
|
||||
pfd = reinterpret_cast<PerFrameData*>(mem);
|
||||
}
|
||||
|
|
|
@ -771,9 +771,10 @@ nsCSSValue::BufferFromString(const nsString& aValue)
|
|||
|
||||
// NOTE: Alloc prouduces a new, already-addref'd (refcnt = 1) buffer.
|
||||
// NOTE: String buffer allocation is currently fallible.
|
||||
buffer = nsStringBuffer::Alloc((length + 1) * sizeof(char16_t));
|
||||
size_t sz = (length + 1) * sizeof(char16_t);
|
||||
buffer = nsStringBuffer::Alloc(sz);
|
||||
if (MOZ_UNLIKELY(!buffer)) {
|
||||
NS_RUNTIMEABORT("out of memory");
|
||||
NS_ABORT_OOM(sz);
|
||||
}
|
||||
|
||||
char16_t* data = static_cast<char16_t*>(buffer->Data());
|
||||
|
|
Загрузка…
Ссылка в новой задаче