30 messages in com.mysql.lists.plusplusRe: Eyeballs needed on new reference ...| From | Sent On | Attachments |
|---|---|---|
| Warren Young | 14 Aug 2007 23:26 | |
| Chris Frey | 15 Aug 2007 01:14 | |
| Alex Burton | 15 Aug 2007 01:42 | |
| Joseph Artsimovich | 15 Aug 2007 01:56 | |
| Joel Fielder | 15 Aug 2007 02:29 | |
| Robert Mecklenburg | 15 Aug 2007 07:47 | |
| Graham Reitz | 15 Aug 2007 08:38 | |
| Graham Reitz | 15 Aug 2007 08:47 | |
| Graham Reitz | 15 Aug 2007 09:03 | |
| Jonathan Wakely | 15 Aug 2007 15:06 | |
| Warren Young | 16 Aug 2007 01:55 | |
| Warren Young | 16 Aug 2007 02:23 | |
| Warren Young | 16 Aug 2007 02:31 | |
| Warren Young | 16 Aug 2007 02:57 | |
| Warren Young | 16 Aug 2007 03:08 | |
| Warren Young | 16 Aug 2007 03:11 | |
| Jonathan Wakely | 17 Aug 2007 17:54 | |
| Jonathan Wakely | 17 Aug 2007 18:00 | |
| Warren Young | 20 Aug 2007 12:09 | |
| Warren Young | 29 Nov 2007 00:04 | |
| Joseph Artsimovich | 29 Nov 2007 04:20 | |
| Warren Young | 29 Nov 2007 05:48 | |
| Jonathan Wakely | 29 Nov 2007 17:40 | |
| Jonathan Wakely | 29 Nov 2007 17:58 | |
| Jonathan Wakely | 29 Nov 2007 18:15 | |
| Warren Young | 30 Nov 2007 22:24 | |
| Warren Young | 30 Nov 2007 22:35 | |
| Warren Young | 30 Nov 2007 22:38 | |
| Warren Young | 17 Dec 2007 05:53 | |
| Jonathan Wakely | 17 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.




