Bug 187246

Summary: String buffer is reallocated in FileSystem::fileSystemRepresentation.
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebCore Misc.Assignee: Per Arne Vollan <pvollan>
Status: NEW ---    
Severity: Normal CC: ap
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ap: review-

Description Per Arne Vollan 2018-07-02 07:19:13 PDT
The length of the new string buffer is computed by CFStringGetMaximumSizeOfFileSystemRepresentation, which over-estimates the required length. To save space, the string buffer is currently reallocated before returning the string. Since the returned string is never stored by any callers as far as I can see, reallocating is not necessary. The caller can reallocate the buffer if the string is going to be stored.
Comment 1 Per Arne Vollan 2018-07-02 07:24:19 PDT
Created attachment 344100 [details]
Patch
Comment 2 Alexey Proskuryakov 2018-07-03 02:26:30 PDT
Comment on attachment 344100 [details]
Patch

svn blame points to http://trac.webkit.org/r149531, which explains why this is necessary.
Comment 3 Per Arne Vollan 2018-07-03 07:44:58 PDT
(In reply to Alexey Proskuryakov from comment #2)
> Comment on attachment 344100 [details]
> Patch
> 
> svn blame points to http://trac.webkit.org/r149531, which explains why this
> is necessary.

Ah, I see. Thanks for reviewing!