unbound 0.1
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

◆ lock

lock_quick_type alloc_cache::lock

◆ super

◆ quar

alloc_special_type* alloc_cache::quar

◆ num_quar

◆ thread_num

int alloc_cache::thread_num

thread number for id creation

Referenced by alloc_get_id(), alloc_init(), and libworker_setup().

◆ next_id

uint64_t alloc_cache::next_id

next id number to pass out

Referenced by alloc_get_id(), and alloc_init().

◆ last_id

uint64_t alloc_cache::last_id

last id number possible

Referenced by alloc_get_id(), and alloc_init().

◆ cleanup

void(*) alloc_cache::cleanup(void *)

what function to call to cleanup when last id is reached

Referenced by alloc_get_id(), alloc_init(), and alloc_set_id_cleanup().

◆ cleanup_arg

void* alloc_cache::cleanup_arg

user arg for cleanup

Referenced by alloc_get_id(), alloc_init(), and alloc_set_id_cleanup().

◆ max_reg_blocks

size_t alloc_cache::max_reg_blocks

how many regional blocks to keep back max

Referenced by alloc_init(), and alloc_reg_release().

◆ num_reg_blocks

size_t alloc_cache::num_reg_blocks

◆ reg_list

struct regional* alloc_cache::reg_list

linked list of regional blocks, using regional->next

Referenced by alloc_clear(), alloc_init(), alloc_reg_obtain(), alloc_reg_release(), and prealloc_blocks().


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