Asterisk - The Open Source Telephony Project  GIT-master-a24979a
Data Fields
ao2_container Struct Reference

Generic container type. More...

#include <astobj2_container_private.h>

Collaboration diagram for ao2_container:
Collaboration graph

Data Fields

unsigned int destroying:1
 TRUE if the container is being destroyed. More...
int elements
uint32_t options
const struct ao2_container_methodsv_table

Detailed Description

Generic container type.

This is the base container type that contains values common to all container types.

Linking and unlinking container objects is typically expensive, as it involves a malloc()/free() of a small object which is very inefficient. To optimize this, we can allocate larger arrays of container nodes when we run out of them, and then manage our own freelist. This will be more efficient as we can do the freelist management while we hold the lock (that we need anyway).

Definition at line 270 of file astobj2_container_private.h.

Field Documentation

◆ cmp_fn

ao2_callback_fn* cmp_fn

Container traversal matching function for ao2_find.

Definition at line 276 of file astobj2_container_private.h.

Referenced by hash_ao2_container_init(), and rb_ao2_container_init().

◆ destroying

unsigned int destroying

TRUE if the container is being destroyed.

The destruction traversal should override any requested search order to do the most efficient order for destruction.
There should not be any empty nodes in the container during destruction. If there are then an error needs to be issued about container node reference leaks.

Definition at line 297 of file astobj2_container_private.h.

Referenced by hash_ao2_node_destructor(), and rb_ao2_node_destructor().

◆ elements

int elements

Number of elements in the container.

Definition at line 280 of file astobj2_container_private.h.

Referenced by __container_unlink_node_debug().

◆ options

uint32_t options

The container option flags

Definition at line 278 of file astobj2_container_private.h.

◆ sort_fn

ao2_sort_fn* sort_fn

Container sort function if the container is sorted.

Definition at line 274 of file astobj2_container_private.h.

Referenced by get_container(), hash_ao2_container_init(), and rb_ao2_container_init().

◆ v_table

const struct ao2_container_methods* v_table

Container virtual method table.

Definition at line 272 of file astobj2_container_private.h.

Referenced by __ao2_container_clone(), __ao2_iterator_next(), and __container_unlink_node_debug().

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