[prev in list] [next in list] [prev in thread] [next in thread]
List: webkit-dev
Subject: Re: [webkit-dev] Smart Pointer Analysis Tool for WebKit
From: Andres Gonzalez via webkit-dev <webkit-dev () lists ! webkit ! org>
Date: 2023-02-27 21:22:17
Message-ID: ADBC6548-4737-4FD7-9C7E-272B891D64EB () apple ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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@lists.webkit.org> wrote:
>
> > On Jan 30, 2023, at 6:29 PM, Fujii Hironori via webkit-dev \
> > <webkit-dev@lists.webkit.org> wrote:
> > On Tue, Jan 31, 2023 at 8:28 AM Ryosuke Niwa via webkit-dev \
> > <webkit-dev@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@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
[Attachment #5 (unknown)]
<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: \
space; line-break: after-white-space;"><span>Thanks Ryosuke for the wiki page. Can \
you please clarify:</span><div><span><br></span><span>"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<>`."<br><br>I \
don't think there is CanMakeThreadSafeWeakPtr{T>. For thread safe WeakPtr \
behavior, you have to inherit from </span><span style="caret-color: rgb(0, 0, \
0); color: rgb(0, 0, \
0);">ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr.</span></div><div><span><font \
color="#000000"><span style="caret-color: rgb(0, 0, \
0);"><br></span></font></span></div><div><span><font \
color="#000000">—Andres.</font></span></div><div><span><font \
color="#000000"><br></font><br><blockquote type="cite">On Jan 30, 2023, at 9:36 PM, \
Ryosuke Niwa via webkit-dev <webkit-dev@lists.webkit.org> wrote:<br><br \
class="Apple-interchange-newline"><br><blockquote type="cite">On Jan 30, 2023, at \
6:29 PM, Fujii Hironori via webkit-dev <webkit-dev@lists.webkit.org> \
wrote:<br><br>On Tue, Jan 31, 2023 at 8:28 AM Ryosuke Niwa via webkit-dev \
<webkit-dev@lists.webkit.org> wrote:<br><blockquote type="cite"><br>I've posted \
https://github.com/WebKit/WebKit/wiki/Smart-Pointer-Usage-Rules<br><br><br></blockquote>Very \
nice. Can I add the following exception for \
webkit.UncountedLambdaCapturesChecker \
rule?<br><br>https://lists.webkit.org/pipermail/webkit-dev/2020-September/031405.html<br><br><blockquote \
type="cite">We probably also need to figure out a way to exempt all lambda \
functions<br>that never get stored anywhere. We have a bunch of helper functions \
like<br>WTF::map which just calls lambdas on each item while iterating over \
an<br>array, etc... and there is no need to create a separate Ref / RefPtr \
in<br>those cases since lambdas are never stored and re-used \
later.<br></blockquote></blockquote><br>Done.<br><br>- R. \
Niwa<br><br>_______________________________________________<br>webkit-dev mailing \
list<br>webkit-dev@lists.webkit.org<br>https://lists.webkit.org/mailman/listinfo/webkit-dev<br></blockquote><br></span><div></div></div></body></html>
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic