#include <refcnt.h>
Data Fields | |
| int | refcnt |
| Current reference count. | |
| void(* | free )(struct refcnt *refcnt) |
| Free containing object. | |
This data structure is designed to be embedded within a reference-counted object.
Reference-counted objects are freed when their reference count drops below zero. This means that a freshly allocated-and-zeroed reference-counted object will be freed on the first call to ref_put().
Definition at line 23 of file refcnt.h.
| int refcnt::refcnt |
| void( * refcnt::free)(struct refcnt *refcnt) |
Free containing object.
This method is called when the reference count is decremented below zero.
If this method is left NULL, the standard library free() function will be called. The upshot of this is that you may omit the free() method if the refcnt object is the first element of your reference-counted struct.
Referenced by add_tls(), alloc_image(), alloc_netdev(), aoe_attach(), create_downloader(), ftp_open(), http_open_filter(), iscsi_attach(), open(), ref_put(), slam_open(), start_dhcp(), start_pxebs(), and tftp_core_open().
1.5.7.1