PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
ref_t Struct Reference

Reference counting structure. More...

#include <ref.h>

Collaboration diagram for ref_t:

Data Fields

uint32_t magic
 
atomic_uint32_t count
 
lock_t lock
 
void(* callback )(void *self)
 Cleanup function called when count reaches zero.
 
list_t weakRefs
 

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 51 of file ref.h.

Field Documentation

◆ magic

uint32_t ref_t::magic

Definition at line 54 of file ref.h.

◆ count

atomic_uint32_t ref_t::count

Definition at line 56 of file ref.h.

◆ lock

lock_t ref_t::lock

Definition at line 57 of file ref.h.

◆ callback

void(* ref_t::callback) (void *self)

Cleanup function called when count reaches zero.

Definition at line 58 of file ref.h.

◆ weakRefs

list_t ref_t::weakRefs

Definition at line 59 of file ref.h.


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