[Webkit-unassigned] [Bug 18665] New: HTMLTokenizer double allocates strings for <script>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 21 12:56:09 PDT 2008


           Summary: HTMLTokenizer double allocates strings for <script>
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mike at belshe.com

In HTMLTokenizer, we call:

   String scriptCode(buffer, dest - buffer);  // this allocates a string
   processToken();   // This allocates another string for the Text in the DOM

So all javascript code gets allocated twice; in the case of the popular web app
I was using, this totalled over 1.3MB of extra space.  (The JS code measured
~650KB, but in UChars, that measures 1.3MB)

I'm attaching a small patch, which passes all layout tests.  The fix is to have
the scriptCode share the string created via the node Text.  The only question I
have is that this string is created via
StringImpl::createStrippingNullCharacters().  Is it possible to have embedded
null characters inside script?  I don't think so, but I am not certain.

Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list