|
PatchworkOS
da8a090
A non-POSIX operating system.
|
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.
| void(* ref_t::free) (void *self) |