<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>313697</bug_id>
          
          <creation_ts>2026-04-29 16:35:23 -0700</creation_ts>
          <short_desc>[SequesteredMalloc] Support arbitrary-size allocations</short_desc>
          <delta_ts>2026-05-07 10:43:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>314224</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcus Plutowski">marcus_plutowski</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2206036</commentid>
    <comment_count>0</comment_count>
    <who name="Marcus Plutowski">marcus_plutowski</who>
    <bug_when>2026-04-29 16:35:23 -0700</bug_when>
    <thetext>rdar://175894622

Currently, the SequesteredImmortalHeap only permits allocation from granules of up to 512K. Previous investigations suggested that this would be sufficient (i.e. none of the types which are SequesteredArenaAlloc’d would allocate near to that amount in one go), but either they were wrong or something has changed since then since we now know of situations where this does happen.

The ideal solution to this is to have two allocation paths: either go down the current pathway (allocating from within a 512K granule) or allocate from a large-heap structure which maintains a free-list and hashmap of arbitrary-size allocations.
This does pose some risk of memory fragmentation in general — this could be ameliorated by landing the patch which pulls in megapage-like structures to reduce the fragmentation induced by the current allocator system. However, since these large-allocations are very likely to be rare in practice, this change can go in without the megapage change for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2206054</commentid>
    <comment_count>1</comment_count>
    <who name="Marcus Plutowski">marcus_plutowski</who>
    <bug_when>2026-04-29 17:25:19 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/63936</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208165</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-06 10:06:26 -0700</bug_when>
    <thetext>Committed 312707@main (c85eac355997): &lt;https://commits.webkit.org/312707@main&gt;

Reviewed commits have been landed. Closing PR #63936 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208223</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2026-05-06 12:29:16 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 314224</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208310</commentid>
    <comment_count>4</comment_count>
    <who name="Marcus Plutowski">marcus_plutowski</who>
    <bug_when>2026-05-06 15:27:54 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64405</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208635</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-07 10:43:18 -0700</bug_when>
    <thetext>Committed 312809@main (06c57fbad9f6): &lt;https://commits.webkit.org/312809@main&gt;

Reviewed commits have been landed. Closing PR #64405 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>