Asterisk - The Open Source Telephony Project  18.5.0
Data Fields
__priv_data Struct Reference

Data Fields

ao2_destructor_fn destructor_fn
 
uint32_t lockused:1
 Set to 1 when the lock is used if refdebug is enabled. More...
 
uint32_t magic:28
 
uint32_t options:3
 The ao2 object option flags. More...
 
int32_t ref_counter
 
void * weakptr
 

Detailed Description

astobj2 objects are always preceded by this data structure, which contains a reference counter, option flags and a pointer to a destructor. The refcount is used to decide when it is time to invoke the destructor. The magic number is used for consistency check.

Definition at line 54 of file astobj2.c.

Field Documentation

◆ destructor_fn

ao2_destructor_fn destructor_fn

Definition at line 55 of file astobj2.c.

Referenced by __ao2_ref(), and internal_ao2_alloc().

◆ lockused

uint32_t lockused

Set to 1 when the lock is used if refdebug is enabled.

Note
This bit-field may be modified after object creation. It shares a uint32_t with options and magic.

Definition at line 77 of file astobj2.c.

Referenced by __ao2_lock(), __ao2_ref(), and __ao2_trylock().

◆ magic

uint32_t magic

◆ options

uint32_t options

The ao2 object option flags.

Note
This field is constant after object creation. It shares a uint32_t with lockused and magic.

Definition at line 70 of file astobj2.c.

Referenced by __adjust_lock(), __ao2_lock(), __ao2_ref(), __ao2_trylock(), __ao2_unlock(), ao2_object_get_lockaddr(), ao2_options_get(), and internal_ao2_alloc().

◆ ref_counter

int32_t ref_counter

Number of references held for this object

Definition at line 63 of file astobj2.c.

Referenced by __ao2_ref(), and internal_ao2_alloc().

◆ weakptr

void* weakptr

This field is used for astobj2 and ao2_weakproxy objects to reference each other

Definition at line 57 of file astobj2.c.

Referenced by __ao2_get_weakproxy(), __ao2_ref(), __ao2_weakproxy_set_object(), and ao2_weakproxy_subscribe().


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