[webkit-dev] Custom String class over STL string class

Darin Adler darin at apple.com
Thu Jan 15 10:22:08 PST 2009


On Jan 15, 2009, at 1:48 AM, wei wang wrote:

> Well I have another question on using string in WebKit. std::string  
> employs its own memory management policy, but I've found that  
> StringImpl uses 'malloc' and 'free' directly. It doesn't use copy-on- 
> write strategy, even in its copy constructor. So how is StringImpl's  
> performance of memory management compared with std::string.

StringImpl objects are rarely used for strings that will be modified.  
They're usually just created and used. I don't know if that answers  
your question.

      -- Darin



More information about the webkit-dev mailing list