WebKit Bugzilla
Attachment 358722 Details for
Bug 193291
: Leak of WTF::StringImpl under SymbolImpl::createNullSymbol() (48 bytes) in com.apple.WebKit.WebContent running layout tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-193291-20190109120606.patch (text/plain), 2.30 KB, created by
David Kilzer (:ddkilzer)
on 2019-01-09 12:06:07 PST
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-01-09 12:06:07 PST
Size:
2.30 KB
patch
obsolete
>Subversion Revision: 239762 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index f8a87b09bcf2cf54fbc89824e6290da7780b9418..9780608512bc8479e9d5535a33bbfebae70d83b1 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-09 David Kilzer <ddkilzer@apple.com> >+ >+ Leak of WTF::StringImpl under SymbolImpl::createNullSymbol() (48 bytes) in com.apple.WebKit.WebContent running layout tests >+ <https://webkit.org/b/193291> >+ <rdar://problem/46655953> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/text/SymbolImpl.cpp: >+ (WTF::SymbolImpl::createNullSymbol): >+ (WTF::PrivateSymbolImpl::createNullSymbol): >+ - Use a NeverDestroyed<> object so that each object only has to >+ be created once. I have never seen a leak under >+ PrivateSymbolImpl::createNullSymbol(), but the idiom seems to >+ be the same as SymbolImpl::createNullSymbol(), so that change >+ may reduce a small amount of memory churn. >+ > 2019-01-07 David Kilzer <ddkilzer@apple.com> > > Prefer RetainPtr<NSObject> to RetainPtr<NSObject *> >diff --git a/Source/WTF/wtf/text/SymbolImpl.cpp b/Source/WTF/wtf/text/SymbolImpl.cpp >index 21899899883057536607d23b77c76fddf3e48959..59662e3d875ee2ea71a232f9edfc2d33fa905aae 100644 >--- a/Source/WTF/wtf/text/SymbolImpl.cpp >+++ b/Source/WTF/wtf/text/SymbolImpl.cpp >@@ -24,7 +24,9 @@ > */ > > #include "config.h" >-#include <wtf/text/SymbolImpl.h> >+#include "SymbolImpl.h" >+ >+#include "NeverDestroyed.h" > > namespace WTF { > >@@ -53,7 +55,8 @@ Ref<SymbolImpl> SymbolImpl::create(StringImpl& rep) > > Ref<SymbolImpl> SymbolImpl::createNullSymbol() > { >- return adoptRef(*new SymbolImpl); >+ static NeverDestroyed<Ref<SymbolImpl>> nullSymbol(adoptRef(*new SymbolImpl)); >+ return nullSymbol.get().get(); > } > > Ref<PrivateSymbolImpl> PrivateSymbolImpl::create(StringImpl& rep) >@@ -67,7 +70,8 @@ Ref<PrivateSymbolImpl> PrivateSymbolImpl::create(StringImpl& rep) > > Ref<PrivateSymbolImpl> PrivateSymbolImpl::createNullSymbol() > { >- return adoptRef(*new PrivateSymbolImpl); >+ static NeverDestroyed<Ref<PrivateSymbolImpl>> nullPrivateSymbol(adoptRef(*new PrivateSymbolImpl)); >+ return nullPrivateSymbol.get().get(); > } > > Ref<RegisteredSymbolImpl> RegisteredSymbolImpl::create(StringImpl& rep, SymbolRegistry& symbolRegistry)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193291
:
358722
|
358730
|
360978