[webkit-changes] [WebKit/WebKit] 603b09: [WTF] Create SequesteredImmortalAllocator

Marcus Plutowski noreply at github.com
Thu Feb 27 23:51:03 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 603b096bc593c733ff459e2b2415237f6a82626f
      https://github.com/WebKit/WebKit/commit/603b096bc593c733ff459e2b2415237f6a82626f
  Author: Marcus Plutowski <marcus_plutowski at apple.com>
  Date:   2025-02-27 (Thu, 27 Feb 2025)

  Changed paths:
    M Source/JavaScriptCore/jit/ExecutableAllocator.cpp
    M Source/WTF/wtf/SequesteredImmortalHeap.cpp
    M Source/WTF/wtf/SequesteredImmortalHeap.h
    M Source/WTF/wtf/SequesteredMalloc.cpp
    M Source/WTF/wtf/SequesteredMalloc.h

  Log Message:
  -----------
  [WTF] Create SequesteredImmortalAllocator
https://bugs.webkit.org/show_bug.cgi?id=288659
rdar://145698858

Reviewed by David Degazio.

This "allocator" essentially leaks memory, but ensures that
all memory allocated will come from the sequestered memory region.
This is necessary for singletons and other objects with near-static
lifetime.

This also changes JSC's FixedVMPoolExecutableAllocator to use
this new allocator, which sequesters (most, but not all) of the
data used by the ExecutibleAllocator.

* Source/JavaScriptCore/jit/ExecutableAllocator.cpp:
* Source/WTF/wtf/SequesteredImmortalHeap.cpp:
(WTF::SequesteredImmortalAllocator::addGranule):
* Source/WTF/wtf/SequesteredImmortalHeap.h:
(WTF::SequesteredImmortalAllocator::allocate):
(WTF::SequesteredImmortalAllocator::alignedAllocate):
(WTF::SequesteredImmortalAllocator::headIncrementedBy const):
(WTF::SequesteredImmortalAllocator::headAlignedUpTo const):
(WTF::SequesteredImmortalAllocator::allocateImpl):
(WTF::SequesteredImmortalAllocator::alignedAllocateImpl):
(WTF::SequesteredImmortalAllocator::allocateImplSlowPath):
(WTF::SequesteredImmortalAllocator::alignedAllocateImplSlowPath):
(WTF::SequesteredImmortalHeap::allocateAndInstall):
(WTF::SequesteredImmortalHeap::immortalMalloc):
(WTF::SequesteredImmortalHeap::immortalAlignedMalloc):
(WTF::SequesteredImmortalHeap::computeSlotIndex):
* Source/WTF/wtf/SequesteredMalloc.cpp:
(WTF::sequesteredImmortalMalloc):
(WTF::sequesteredImmortalAlignedMalloc):
* Source/WTF/wtf/SequesteredMalloc.h:

Canonical link: https://commits.webkit.org/291309@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list