[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: about reference counter
On Fri, 2004-10-01 at 17:45 -0400, lml@xxxxxxxxxxxxxxxx wrote:
> So what is the real purpose of using reference counter? It cannot protect other
> members in the object. Looks like it is only used to check if the object needed
> to be freed (when the counter is 0)? right? Can you give an example?
Yes. More specifically, you could look at it as ensuring that the
object is _not_ freed until no one has a reference to it any more.
Robert Love
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/