30 messages in com.mysql.lists.plusplusRe: Eyeballs needed on new reference ...
FromSent OnAttachments
Warren Young14 Aug 2007 23:26 
Chris Frey15 Aug 2007 01:14 
Alex Burton15 Aug 2007 01:42 
Joseph Artsimovich15 Aug 2007 01:56 
Joel Fielder15 Aug 2007 02:29 
Robert Mecklenburg15 Aug 2007 07:47 
Graham Reitz15 Aug 2007 08:38 
Graham Reitz15 Aug 2007 08:47 
Graham Reitz15 Aug 2007 09:03 
Jonathan Wakely15 Aug 2007 15:06 
Warren Young16 Aug 2007 01:55 
Warren Young16 Aug 2007 02:23 
Warren Young16 Aug 2007 02:31 
Warren Young16 Aug 2007 02:57 
Warren Young16 Aug 2007 03:08 
Warren Young16 Aug 2007 03:11 
Jonathan Wakely17 Aug 2007 17:54 
Jonathan Wakely17 Aug 2007 18:00 
Warren Young20 Aug 2007 12:09 
Warren Young29 Nov 2007 00:04 
Joseph Artsimovich29 Nov 2007 04:20 
Warren Young29 Nov 2007 05:48 
Jonathan Wakely29 Nov 2007 17:40 
Jonathan Wakely29 Nov 2007 17:58 
Jonathan Wakely29 Nov 2007 18:15 
Warren Young30 Nov 2007 22:24 
Warren Young30 Nov 2007 22:35 
Warren Young30 Nov 2007 22:38 
Warren Young17 Dec 2007 05:53 
Jonathan Wakely17 Dec 2007 12:39 
Subject:Re: Eyeballs needed on new reference counted pointer template
From:Warren Young (mysq@etr-usa.com)
Date:11/30/2007 10:35:51 PM
List:com.mysql.lists.plusplus

Jonathan Wakely wrote:

On 29/11/2007, Warren Young <mysq@etr-usa.com> wrote:

And in the assign(T*) case, I'm pretty sure assigning the same pointer will result in a double-delete. I've added explicit checks to both assign() overloads.

Forgot to answer this bit ... that can only happen as a result of a stupid programming error, you'd have to say: p1.assign( p2.get() ) so it's pretty obvious you've just made p1 and p2 own the same resource, but without sharing a refcount.

Oh, crumb...This is the very error I foresaw when I decided the guard was necessary for the T* case, but in processing your previous message, I convinced myself it couldn't happen.

Actually, I conceived of it happening a little more verbosely:

Foo* bar = something_that_makes_foos(); ... many fascinating and interesting things happen here ... RefCountedPointer<Foo> qux(bar); ... still other stuff happens ... qux = bar; // who knows why, but say you do this...

Still unlikely, I admit...

I guess I'm satisfied leaving it unprotected until a need for protection is demonstrated.

I probably should have added comments to explain some of the code ...

It's always a third party that tells you how extensive the documentation needs to be. I'd only expect excellent documentation from you on these patches about six months from now when you are new to it again.

I discover lapses and even outright errors in the userman, for example, almost every time I reread a section of it. That's one reason I do it.