The change to SkRefCnt to add SkBlockRef was because I changed the SkStreams here to ...
12 years, 5 months ago
(2012-06-01 14:17:16 UTC)
#1
The change to SkRefCnt to add SkBlockRef was because I changed the SkStreams
here to use SkAutoTUnref and I forgot to remove one of the obj->unref() calls.
Since the SkAutoTUnref is the one which owns the ref it should block easy access
to the ref and unref to mark such mistakes as compile time errors.
http://codereview.appspot.com/6263046/diff/5/include/core/SkRefCnt.h File include/core/SkRefCnt.h (right): http://codereview.appspot.com/6263046/diff/5/include/core/SkRefCnt.h#newcode116 include/core/SkRefCnt.h:116: If we're going to add this to such a ...
12 years, 5 months ago
(2012-06-01 16:32:20 UTC)
#3
On 2012/06/01 14:17:16, bungeman wrote: > The change to SkRefCnt to add SkBlockRef was because ...
12 years, 5 months ago
(2012-06-01 18:24:49 UTC)
#5
On 2012/06/01 14:17:16, bungeman wrote:
> The change to SkRefCnt to add SkBlockRef was because I changed the SkStreams
> here to use SkAutoTUnref and I forgot to remove one of the obj->unref() calls.
> Since the SkAutoTUnref is the one which owns the ref it should block easy
access
> to the ref and unref to mark such mistakes as compile time errors.
I disagree with the premise here. SkAUtoTUnref doesn't hold *the* reference, it
holds a reference and there may be others. It doesn't seem like the errors that
this change could catch are worth the extra machinery. Those errors will be
caught further down the line anyway with Chrome's memory bots and as I
understand it there are plans to bring memory bots to the Skia waterfall.
On 2012/06/01 18:24:49, Steve VanDeBogart wrote: > On 2012/06/01 14:17:16, bungeman wrote: > > The ...
12 years, 5 months ago
(2012-06-01 19:28:04 UTC)
#7
On 2012/06/01 18:24:49, Steve VanDeBogart wrote:
> On 2012/06/01 14:17:16, bungeman wrote:
> > The change to SkRefCnt to add SkBlockRef was because I changed the SkStreams
> > here to use SkAutoTUnref and I forgot to remove one of the obj->unref()
calls.
> > Since the SkAutoTUnref is the one which owns the ref it should block easy
> access
> > to the ref and unref to mark such mistakes as compile time errors.
>
> I disagree with the premise here. SkAUtoTUnref doesn't hold *the* reference,
it
> holds a reference and there may be others. It doesn't seem like the errors
that
> this change could catch are worth the extra machinery. Those errors will be
> caught further down the line anyway with Chrome's memory bots and as I
> understand it there are plans to bring memory bots to the Skia waterfall.
Of course it holds *the* reference, it holds *the* reference which it currently
controls because someone passed it in. There exist no other references in the
context. All scoped pointers which wrap intrusive reference counted things do
this as a matter of course, see SkTScopedComPtr and Chromium's
base/win/scoped_comptr.h. There's no point in having a heavy memory checker find
these sorts of problems later when it's possible for your IDE/compiler to tell
you immediately. There is no extra generated code, it's all just types.
Issue 6263046: Serialize support for GDI.
(Closed)
Created 12 years, 5 months ago by bungeman
Modified 12 years, 5 months ago
Reviewers: DerekS, reed1, Steve VanDeBogart
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 15