Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r183959 - Release assert in com.apple.WebKit.WebContent under J…
…avaScriptCore: JSC::JSONProtoFuncStringify https://bugs.webkit.org/show_bug.cgi?id=144758 Reviewed by Andreas Kling. This was an out-of-memory error when trying to shrink a string builder. bmalloc was missing the optimization that allowed realloc() to shrink without copying. So, let's add it. * bmalloc/Allocator.cpp: (bmalloc::Allocator::reallocate): Added Large and XLarge cases for shrinking without copying. This isn't possible for small and medium objects, and probably not very profitable, either. * bmalloc/Heap.cpp: (bmalloc::Heap::findXLarge): (bmalloc::Heap::deallocateXLarge): * bmalloc/Heap.h: Refactored this code to return a reference to an XLarge range. This makes the code reusable, and also makes it easier for realloc() to update metadata. * bmalloc/LargeObject.h: (bmalloc::LargeObject::split): Allow allocated objects to split because that's what realloc() wants to do, and there's nothing intrinsically wrong with it.
- Loading branch information
1 parent
62beef3
commit 6cc00f6
Showing
6 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters