The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Resource pool management using slabs of memory. More...
#include <freeradius-devel/util/dlist.h>
#include <freeradius-devel/util/event.h>
Go to the source code of this file.
Data Structures | |
struct | fr_slab_config_t |
Tuneable parameters for slabs. More... | |
Macros | |
#define | FR_SLAB_CONFIG_conf_parser_t |
conf_parser_t entries to populate user configurable slab values More... | |
#define | FR_SLAB_FUNCS(_name, _type) |
Define type specific wrapper functions for slabs and slab elements. More... | |
#define | FR_SLAB_TYPES(_name, _type) |
Define type specific wrapper structs for slabs and slab elements. More... | |
Resource pool management using slabs of memory.
Definition in file slab.h.
struct fr_slab_config_t |
Data Fields | ||
---|---|---|
bool | at_max_fail | Should requests for additional elements fail when the number in use has reached max_elements. |
size_t | child_pool_size | Size of pool space to be allocated to each element. |
unsigned int | elements_per_slab | Number of elements to allocate per slab. |
fr_time_delta_t | interval | Interval between slab cleanup events being fired. |
unsigned int | max_elements | Maximum number of elements to allocate using slabs. |
unsigned int | min_elements | Minimum number of elements to keep allocated. |
unsigned int | num_children | How many child allocations are expected off each element. |
#define FR_SLAB_CONFIG_conf_parser_t |
conf_parser_t entries to populate user configurable slab values
#define FR_SLAB_FUNCS | ( | _name, | |
_type | |||
) |
Define type specific wrapper functions for slabs and slab elements.
[in] | _name | used in type specific structures. |
[in] | _type | of structure returned by the reserve function. |
#define FR_SLAB_TYPES | ( | _name, | |
_type | |||
) |
Define type specific wrapper structs for slabs and slab elements.
The top level structure is the slab_list. Slab elements are reserved from this list. One or more slabs are created as children of the slab_list each of which consist of a number of elements.
Within the slab_list there are two dlists which hold the slabs. Slabs in the reserved
list have all their elements in use. Slabs in the avail
list have elements available to reserve.
Allocation of new elements can cause an allocation callback to be invoked if elements need initialisation.
[in] | _name | to use in type specific structures. |
[in] | _type | of structure which will be held in the slab elements. |