On Wed, Feb 3, 2010 at 2:51 PM, Roy Stogner <[email protected]> wrote:
>
> On Wed, 3 Feb 2010, Derek Gaston wrote:
>
>> On Feb 3, 2010, at 1:39 PM, Roy Stogner wrote:
>>
>>> Surprised me too, actually.  I think it would be better to turn off
>>> counting entirely when asked via configure (especially since it
>>> requires an atomic unsigned int when threading is on), do the "one
>>> total count" stuff in opt mode with counting on, then do the detailed
>>> stuff in dbg/devel mode with counting on.
>>
>> I like this idea... I hadn't even thought about the impact to
>> threading with that atomic int (there's a mutex in there too... but
>> it looks like it might just be used in DEBUG mode).
>>
>> I can do the disabling of the _n_objects++ in the constructor /
>> destructor right now if you would like.
>
> Let's wait on Ben and John's opinions.

(Something is funny withe either my gmail or the list today.  I'm
getting messages all out of order...)

I think the right way to go is to not derive any classes from
ReferenceCountedObject if you want to completely disable reference
counting.

class MyClass
#ifdef LIBMESH_ENABLE_REFERENCE_COUNTING
: public ReferenceCountedObject<MyClass>
#endif
{
};...

If you just disable the ctor and dtor code that would work, but
supposing the RC class got more sophisticated in the future, you'd
have to remember to #ifdef that out as well... etc.  This is more work
up-front but I think cleaner down the line.

-- 
John

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to