|
Boost : |
From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-07-17 17:37:37
Hello Mathias
----- Mensaje original -----
De: loufoque <mathias.gaunard_at_[hidden]>
Fecha: Lunes, Julio 17, 2006 7:38 pm
Asunto: Re: [boost] [flyweight] new draft uploaded at vault
> JOAQUIN LOPEZ MUNOZ wrote :
> > Hello,
> >
> > Given that the response to my initial prompt for
> > interest in a flyweight library was encouraging,
> > I've worked a little more in it to the point that I
> > can show now a pretty functional lib along with
> > some docs. Please download at Vault/Patterns:
> >
> > http://tinyurl.com/f7fum
>
> The documentation doesn't really says how memory management is done.
> Could you give more info about this ?
Well, this is meant to be an implementation detail, as
different factories can do it in different ways, but
the current ones are like this: value objects are stored
in a static STL-like container (the factory core) along
with some housekeeping info (a refcounting var and
some more stuff), and what the flyweight really boils
down to is an intrusive_ptr to this value element. When
the refcount reaches zero, the element autoerases itself
from the container.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk