Electroneum
alloc_cache Struct Reference

#include <alloc.h>

Collaboration diagram for alloc_cache:

Public Attributes

lock_quick_type lock
 
struct alloc_cachesuper
 
alloc_special_typequar
 
size_t num_quar
 
int thread_num
 
uint64_t next_id
 
uint64_t last_id
 
void(* cleanup )(void *)
 
void * cleanup_arg
 
size_t max_reg_blocks
 
size_t num_reg_blocks
 
struct regionalreg_list
 

Detailed Description

Structure that provides allocation. Use one per thread. The one on top has a NULL super pointer.

Definition at line 72 of file alloc.h.

Member Data Documentation

◆ cleanup

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

what function to call to cleanup when last id is reached

Definition at line 88 of file alloc.h.

◆ cleanup_arg

void* alloc_cache::cleanup_arg

user arg for cleanup

Definition at line 90 of file alloc.h.

◆ last_id

uint64_t alloc_cache::last_id

last id number possible

Definition at line 86 of file alloc.h.

◆ lock

lock_quick_type alloc_cache::lock

lock, only used for the super.

Definition at line 74 of file alloc.h.

◆ max_reg_blocks

size_t alloc_cache::max_reg_blocks

how many regional blocks to keep back max

Definition at line 93 of file alloc.h.

◆ next_id

uint64_t alloc_cache::next_id

next id number to pass out

Definition at line 84 of file alloc.h.

◆ num_quar

size_t alloc_cache::num_quar

number of items in quarantine.

Definition at line 80 of file alloc.h.

◆ num_reg_blocks

size_t alloc_cache::num_reg_blocks

how many regional blocks are kept now

Definition at line 95 of file alloc.h.

◆ quar

alloc_special_type* alloc_cache::quar

singly linked lists of special type. These are free for use.

Definition at line 78 of file alloc.h.

◆ reg_list

struct regional* alloc_cache::reg_list

linked list of regional blocks, using regional->next

Definition at line 97 of file alloc.h.

◆ super

struct alloc_cache* alloc_cache::super

global allocator above this one. NULL for none (malloc/free)

Definition at line 76 of file alloc.h.

◆ thread_num

int alloc_cache::thread_num

thread number for id creation

Definition at line 82 of file alloc.h.


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