ao2_container Struct Reference

Generic container type. More...

#include <astobj2_container_private.h>

Collaboration diagram for ao2_container:

Collaboration graph
[legend]

Data Fields

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

Detailed Description

Generic container type.

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

Todo:
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 295 of file astobj2_container_private.h.


Field Documentation

Container traversal matching function for ao2_find.

Definition at line 301 of file astobj2_container_private.h.

Referenced by __ao2_find(), and __ao2_find_debug().

unsigned int destroying

TRUE if the container is being destroyed.

Note:
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 322 of file astobj2_container_private.h.

Referenced by container_destruct(), container_destruct_debug(), hash_ao2_node_destructor(), and rb_ao2_node_destructor().

int elements

Number of elements in the container.

Definition at line 305 of file astobj2_container_private.h.

Referenced by __container_unlink_node_debug(), and ao2_container_count().

uint32_t options

The container option flags

Definition at line 303 of file astobj2_container_private.h.

Container sort function if the container is sorted.

Definition at line 299 of file astobj2_container_private.h.


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

Generated on Thu Apr 16 06:34:53 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6