|
PatchworkOS
|
Reference counting structure. More...
#include <ref.h>
Data Fields | |
| uint32_t | magic |
| Debug magic value to detect corruption. | |
| atomic_uint32_t | count |
| Atomic reference counter. | |
| void(* | free )(void *self) |
| Cleanup function called when count reaches zero. | |
Reference counting structure.
Provides a generic interface for reference counting. Must be placed as the first element in any struct that requires reference counting.
| atomic_uint32_t ref_t::count |
Atomic reference counter.
Definition at line 40 of file ref.h.
Referenced by process_kill(), ref_dec(), ref_inc(), ref_init(), vfs_get_dentry_internal(), and vfs_get_inode().
| void(* ref_t::free) (void *self) |
Cleanup function called when count reaches zero.
Definition at line 44 of file ref.h.
Referenced by ref_dec(), and ref_init().
| uint32_t ref_t::magic |
Debug magic value to detect corruption.
Definition at line 35 of file ref.h.
Referenced by ref_dec(), ref_inc(), and ref_init().