13 * This data structure is designed to be embedded within a
14 * reference-counted object.
17 /** Current reference count
19 * When this count is decremented below zero, the free()
20 * method will be called.
23 /** Free containing object
25 * This method is called when the reference count is
26 * decremented below zero.
28 * If this method is left NULL, the standard library free()
29 * function will be called. The upshot of this is that you
30 * may omit the free() method if the @c refcnt object is the
31 * first element of your reference-counted struct.
33 void ( * free ) ( struct refcnt *refcnt );
36 extern void ref_get ( struct refcnt *refcnt );
37 extern void ref_put ( struct refcnt *refcnt );
39 #endif /* _GPXE_REFCNT_H */