зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug 62791 - realloc now does in-place realloc when it can. r=pinkerton, sr=beard
This commit is contained in:
Родитель
f09d25e85c
Коммит
24c2721346
|
@ -615,6 +615,12 @@ void *malloc(size_t blockSize)
|
|||
static UInt32 sBlockID = 0;
|
||||
blockHeader->blockID = sBlockID++;
|
||||
}
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
DebugStr("\pAllocation failure");
|
||||
}
|
||||
#endif
|
||||
return newBlock;
|
||||
#else
|
||||
|
||||
|
@ -677,15 +683,15 @@ void* realloc(void* block, size_t newSize)
|
|||
switch (allocator->GetAllocatorType())
|
||||
{
|
||||
case nsMemAllocator::eAllocatorTypeFixed:
|
||||
((nsFixedSizeAllocator*)allocator)->AllocatorResizeBlock(block, newSize);
|
||||
newBlock = ((nsFixedSizeAllocator*)allocator)->AllocatorResizeBlock(block, newSize);
|
||||
break;
|
||||
|
||||
case nsMemAllocator::eAllocatorTypeSmall:
|
||||
((nsSmallHeapAllocator*)allocator)->AllocatorResizeBlock(block, newSize);
|
||||
newBlock = ((nsSmallHeapAllocator*)allocator)->AllocatorResizeBlock(block, newSize);
|
||||
break;
|
||||
|
||||
case nsMemAllocator::eAllocatorTypeLarge:
|
||||
((nsLargeHeapAllocator*)allocator)->AllocatorResizeBlock(block, newSize);
|
||||
newBlock = ((nsLargeHeapAllocator*)allocator)->AllocatorResizeBlock(block, newSize);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче