Boost logo

Glas :

Re: [glas] Reference counting?

From: Bert Rodiers (bert.rodiers_at_[hidden])
Date: 2007-10-12 09:07:08


Hello Karl,

An example:

You have a class CVec, the data is stored in seperate class CView to which
CVec points. CView also has a reference count. At the moment you create a
CVec a CView is recreated with reference count 1, when a new CVec is created
from an existing one, the CView is being shared and the reference count is
increased (with a function call). When a CVec is destroyed, you decrease the
reference count (with a function call) and when the reference count becomes
zero you destroy the object.
I could point you to books that discuss reference counting in more detail...

Regards,
Bert

On 12/10/2007, Karl Meerbergen <Karl.Meerbergen_at_[hidden] > wrote:
>
> Hi Neal,
>
> I have not thought of this. I am a bit puzzled. Can you explain what you
> mean by reference counting? Do you mean that a container will only
> disappear when all its references by other objects disappear?
>
> Thanks,
>
> Karl
>
>
>
> Neal Becker wrote:
>
> >I'm looking at the glas alpha docs. I've been studying blitz++ recently,
> and
> >I have (so far) liked the use of reference counting.
> >
> >A slice of an array returns a (shared) view of the array data. Reference
> >counting is used for memory management.
> >
> >I read the comments in glas regarding assignment vs. copy
> construction. Have
> >you considered using ref counting instead?
> >_______________________________________________
> >glas mailing list
> >glas_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/glas
> >
> >
>
>
> _______________________________________________
> glas mailing list
> glas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/glas
>
>