My most recent article submission ("Abstract Factory Revisited") to the
ACM patterns archive uses smart pointers for all memory management.

Smart pointers are implemented using reference-counts, so that when
the count drops to zero, the object is automatically returned to a
storage pool.

It's actually more sophisticated than that, because the Free operation
is primitive, and dispatches according to the tag of the object
designated by smart pointer.  Each type in the class implements its own
pool, from which it draws new instances, and to which it returns old
ones.

A rather nice idiom to know, if I do say so myself!

Matt



"Lipscomb, Kevin" <[log in to unmask]> writes:

> My development team is responsible for writing and maintaining applications
> for which high-availability is a requirement.  Once launched, our programs
> should run continuously for days or weeks.
>
> As one might imagine, memory leaks are a great concern to us.  Does anyone
> know of a collection of software components in Ada that provide
> reference-counted objects?  How about bindings, or binding wrappers, that
> provide reference-counting?
>
> In the book, _Design Patterns_, reference-counted objects are covered in the
> section on the pattern Proxy.  Unfortunately, I have not read the entire
> book yet (I will, I promise.)  Can anyone recommend other patterns that are
> particularly applicable in the domain of high-availability software
> applications -- design patterns that we'd really be foolish to be without?
>
> -- Kevin Andrew Lipscomb
> -- CV, PGP keys, etc: http://users.exis.net/~klips