[webkit-dev] Smart Pointer Analysis Tool for WebKit

Andres Gonzalez andresg_22 at apple.com
Mon Feb 27 13:22:17 PST 2023


Thanks Ryosuke for the wiki page. Can you please clarify:

"To use `WeakPtr` or `ThreadSafeWeakPtr`, make the class inherit from `CanMakeWeakPtr<T>` or `CanMakeThreadSafeWeakPtr<T>`, whichever is appropriate.  Note that classes that want to implement both `ThreadSafeRefCounted` and `ThreadSafeWeakPtr` must inherit from `ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<>`.”

I don’t think there is CanMakeThreadSafeWeakPtr{T>. For thread safe WeakPtr behavior, you have to inherit from ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr.

—Andres.


> On Jan 30, 2023, at 9:36 PM, Ryosuke Niwa via webkit-dev <webkit-dev at lists.webkit.org> wrote:
> 
> 
>> On Jan 30, 2023, at 6:29 PM, Fujii Hironori via webkit-dev <webkit-dev at lists.webkit.org> wrote:
>> 
>> On Tue, Jan 31, 2023 at 8:28 AM Ryosuke Niwa via webkit-dev <webkit-dev at lists.webkit.org> wrote:
>>> 
>>> I’ve posted https://github.com/WebKit/WebKit/wiki/Smart-Pointer-Usage-Rules
>>> 
>>> 
>> Very nice.  Can I add the following exception for webkit.UncountedLambdaCapturesChecker rule?
>> 
>> https://lists.webkit.org/pipermail/webkit-dev/2020-September/031405.html
>> 
>>> We probably also need to figure out a way to exempt all lambda functions
>>> that never get stored anywhere. We have a bunch of helper functions like
>>> WTF::map which just calls lambdas on each item while iterating over an
>>> array, etc... and there is no need to create a separate Ref / RefPtr in
>>> those cases since lambdas are never stored and re-used later.
> 
> Done.
> 
> - R. Niwa
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20230227/e7421250/attachment.htm>


More information about the webkit-dev mailing list