WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
227957.patch (text/plain), 2.30 KB, created by
Michael Saboff
on 2021-07-14 10:21:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Saboff
Created:
2021-07-14 10:21:59 PDT
Size:
2.30 KB
patch
obsolete
>Index: Source/bmalloc/ChangeLog >=================================================================== >--- Source/bmalloc/ChangeLog (revision 279909) >+++ Source/bmalloc/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2021-07-14 Michael Saboff <msaboff@apple.com> >+ >+ [BMalloc] Lazily allocate physical pages >+ https://bugs.webkit.org/show_bug.cgi?id=227957 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ For Darwin platform we don't need to call madvise(..., MADV_FREE_REUSE) to commit physical >+ memory to back an range of allocated virtual memory. Instead the kernel will commit pages >+ as they are touched. This can reduce the footprint of a process when there is sparse access >+ of allocated memory. >+ >+ Also fixed a minor bug where we allocate memory, but don't update the amount of physical memory >+ associated with it. >+ >+ * bmalloc/Heap.cpp: >+ (bmalloc::Heap::tryAllocateLargeChunk): >+ * bmalloc/VMAllocate.h: >+ (bmalloc::vmAllocatePhysicalPages): >+ > 2021-07-12 Filip Pizlo <fpizlo@apple.com> and Yusuke Suzuki <ysuzuki@apple.com> > > New malloc algorithm >Index: Source/bmalloc/bmalloc/Heap.cpp >=================================================================== >--- Source/bmalloc/bmalloc/Heap.cpp (revision 279909) >+++ Source/bmalloc/bmalloc/Heap.cpp (working copy) >@@ -586,7 +586,7 @@ LargeRange Heap::tryAllocateLargeChunk(s > PerProcess<Zone>::get()->addRange(Range(memory, size)); > #endif > >- return LargeRange(memory, size, 0, 0, memory); >+ return LargeRange(memory, size, size, size, static_cast<char*>(memory) + size); > } > > size_t Heap::largeSize(UniqueLockHolder&, void* object) >Index: Source/bmalloc/bmalloc/VMAllocate.h >=================================================================== >--- Source/bmalloc/bmalloc/VMAllocate.h (revision 279909) >+++ Source/bmalloc/bmalloc/VMAllocate.h (working copy) >@@ -213,10 +213,11 @@ inline void vmDeallocatePhysicalPages(vo > > inline void vmAllocatePhysicalPages(void* p, size_t vmSize) > { >- vmValidatePhysical(p, vmSize); > #if BOS(DARWIN) >- SYSCALL(madvise(p, vmSize, MADV_FREE_REUSE)); >+ BUNUSED_PARAM(p); >+ BUNUSED_PARAM(vmSize); > #else >+ vmValidatePhysical(p, vmSize); > SYSCALL(madvise(p, vmSize, MADV_NORMAL)); > #if BOS(LINUX) > SYSCALL(madvise(p, vmSize, MADV_DODUMP));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 227957
: 433509