PatchworkOS
Loading...
Searching...
No Matches
ref_t Struct Reference

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.
 

Detailed Description

Reference counting structure.

Provides a generic interface for reference counting. Must be placed as the first element in any struct that requires reference counting.

Definition at line 29 of file ref.h.

Field Documentation

◆ count

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().

◆ free

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().

◆ magic

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().


The documentation for this struct was generated from the following file: