Changeset 279922 in webkit
- Timestamp:
- Jul 14, 2021, 2:18:22 PM (5 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
bmalloc/Heap.cpp (modified) (1 diff)
-
bmalloc/VMAllocate.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r279867 r279922 1 2021-07-14 Michael Saboff <msaboff@apple.com> 2 3 [BMalloc] Lazily allocate physical pages 4 https://bugs.webkit.org/show_bug.cgi?id=227957 5 6 Reviewed by Mark Lam. 7 8 For the Darwin platform we don't need to call madvise(..., MADV_FREE_REUSE) to commit physical 9 memory to back a range of allocated virtual memory. Instead the kernel will commit pages 10 as they are touched. This can reduce the footprint of a process when there is sparse access 11 of allocated memory. 12 13 Also fixed a minor bug where we allocate memory, but don't update the amount of physical memory 14 associated with it. 15 16 * bmalloc/Heap.cpp: 17 (bmalloc::Heap::tryAllocateLargeChunk): 18 * bmalloc/VMAllocate.h: 19 (bmalloc::vmAllocatePhysicalPages): 20 1 21 2021-07-12 Filip Pizlo <fpizlo@apple.com> and Yusuke Suzuki <ysuzuki@apple.com> 2 22 -
trunk/Source/bmalloc/bmalloc/Heap.cpp
r279867 r279922 587 587 #endif 588 588 589 return LargeRange(memory, size, 0, 0, memory);589 return LargeRange(memory, size, size, size, static_cast<char*>(memory) + size); 590 590 } 591 591 -
trunk/Source/bmalloc/bmalloc/VMAllocate.h
r263371 r279922 216 216 vmValidatePhysical(p, vmSize); 217 217 #if BOS(DARWIN) 218 SYSCALL(madvise(p, vmSize, MADV_FREE_REUSE)); 218 BUNUSED_PARAM(p); 219 BUNUSED_PARAM(vmSize); 220 // For the Darwin platform, we don't need to call madvise(..., MADV_FREE_REUSE) 221 // to commit physical memory to back a range of allocated virtual memory. 222 // Instead the kernel will commit pages as they are touched. 219 223 #else 220 224 SYSCALL(madvise(p, vmSize, MADV_NORMAL));
Note:
See TracChangeset
for help on using the changeset viewer.