Bug 264971
Summary: | ScriptBuffer append with empty string adds empty segment | ||
---|---|---|---|
Product: | WebKit | Reporter: | Cristian Linte <ioancris> |
Component: | WebCore JavaScript | Assignee: | Mark Lam <mark.lam> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | jean-yves.avenard, mark.lam, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Local Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Cristian Linte
ScriptBufferSourceProvider sometimes receives a ScriptBuffer with 2 data segments where 2nd segment is empty (size 0, buffer null). The 2nd empty segment was likely added in WorkerScriptLoader::didFinishLoading by append(decoder->flush()) where flush can return an empty string.
ScriptBufferSourceProvider will call makeContiguous on scriptBuffer which for the above case end up making an unnecessary copy and this memory is kept alive by ScriptBufferSourceProvider thus increasing memory usage.
ScriptBuffer should not add an empty segment to the buffer when append is called with empty string.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/118752844>
Mark Lam
Pull request: https://github.com/WebKit/WebKit/pull/20855
EWS
Committed 271275@main (d445ae96c998): <https://commits.webkit.org/271275@main>
Reviewed commits have been landed. Closing PR #20855 and removing active labels.