|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 1998-12-08 10:37:11
Kühl, Dietmar (Dietmar.Kuehl_at_[hidden]) wrote:
>... and, of course, there is another issue: Embedded reference counts
>are for efficiency purposes, amoung other efficency considerations
>for space efficency. If it is known somehow that the number of
>simultaneous references is relatively small (eg. < 100) it can be
>reasonable to use a spare 'unsigned char' or some bits of a bitfield for
>a reference count (well, this bitfield is not covered by my previous
>proposal). ... and, yes, I have this situation! I use reference
>counted pointers to maintain edge lists in large sparse graphs (eg.
>[parts of] the European railroad system). For each edge I need
>some Boolean flags and I have some spare bytes which are left
>empty for alignment purposes. I could use one of them for reference
>counting since the reference count is fairly small (I think it is at most
>4 during some graph manipulations).
As far as I'm concerned, that's a good enough reason to avoid the base class approach.
-Dave
--------------------------------------------------------------
David Abrahams * Mark of the Unicorn, Inc. * abrahams_at_[hidden]
------------------------------------------------------------------------
Free Web-based e-mail groups -- http://www.eGroups.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk