[Webkit-unassigned] [Bug 25779] New: Allow Strings to be created with one malloc node with no copying

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 13 20:33:53 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25779

           Summary: Allow Strings to be created with one malloc node with no
                    copying
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: davemoore at google.com


Currently when creating StringImpls we have to choose between these two apis:

    static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
    static PassRefPtr<StringImpl> adopt(StringBuffer&);

The first mallocs an object big enough to hold both the StringImpl and a buffer
to contain the characters that are passed to it. These characters are copied.
The second doesn't copy the characters but you have to create a second object,
the StringBuffer, which hands its character buffer to the StringImpl.

I would like to add a new method,
    static String createUninitialized(unsigned length, UChar*& data);

on String that returns a pointer to the inline buffer so that the caller can
fill the characters in, yielding a String with one malloc node without any
copying.


-- 
Configure bugmail: https://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