<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - bmalloc: extra large allocations could be more efficient"
   href="https://bugs.webkit.org/show_bug.cgi?id=151817">151817</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>bmalloc: extra large allocations could be more efficient
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>msaboff&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>BMalloc aligns extra large allocations to start on super chunk size aligned addresses.  It does this by increasing the allocation size to be at least two super chunks and then deallocating the front and back memory to get the start address to be super chunk aligned.  Given that the super chunk size is 4MB, we always ask the OS for 8MB for allocations 2MB or more and return the unused.  It makes sense to reduce the super chunk size to 2MB.

Secondly, when realloc is called on an extra large allocated piece of memory, we always allocate new memory and memcpy from the old.  There is a good possibility that we can get the memory for the increase from adjacently allocated memory, thus saving having both region allocated at once and the memcpy.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>