unbound: alloc_cache Struct Reference

unbound 0.1

Data Fields
alloc_cache Struct Reference

Structure that provides allocation. More...

`#include <alloc.h>`

## Data Fields
lock_quick_type | lock
| lock, only used for the super.
struct alloc_cache * | super
| global allocator above this one.
alloc_special_type * | quar
| singly linked lists of special type.
size_t | num_quar
| number of items in quarantine.
int | thread_num
| thread number for id creation
uint64_t | next_id
| next id number to pass out
uint64_t | last_id
| last id number possible
void(* | cleanup )(void *)
| what function to call to cleanup when last id is reached
void * | cleanup_arg
| user arg for cleanup
size_t | max_reg_blocks
| how many regional blocks to keep back max
size_t | num_reg_blocks
| how many regional blocks are kept now
struct regional * | reg_list
| linked list of regional blocks, using regional->next

## Detailed Description

Structure that provides allocation.

Use one per thread. The one on top has a NULL super pointer.

## Field Documentation

## ◆ super

struct alloc_cache* alloc_cache::super

global allocator above this one.

NULL for none (malloc/free)

Referenced by alloc_clear(), alloc_clear_special(), alloc_get_mem(), alloc_init(), alloc_special_obtain(), alloc_special_release(), alloc_stats(), context_obtain_alloc(), context_release_alloc(), pushintosuper(), and ub_ctx_delete().

## ◆ quar

alloc_special_type* alloc_cache::quar

singly linked lists of special type.

These are free for use.

Referenced by alloc_clear(), alloc_clear_special(), alloc_clear_special_list(), alloc_get_mem(), alloc_special_obtain(), alloc_special_release(), prealloc_setup(), and pushintosuper().

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

- util/alloc.h