mp_chunk_t Struct Reference


Data Fields

unsigned long magic
mp_chunk_tnext
mp_chunk_tprev
mp_pool_tpool
mp_allocated_tfirst_free
int n_allocated
int capacity
size_t mem_size
char * next_mem
char mem [1]

Detailed Description

A chunk of memory. Chunks come from malloc; we use them

Field Documentation

unsigned long mp_chunk_t::magic

Must be MP_CHUNK_MAGIC if this chunk is valid.

Referenced by mp_pool_clean(), and mp_pool_release().

The next free, used, or full chunk in sequence.

Referenced by mp_pool_clean(), mp_pool_get(), mp_pool_log_status(), and mp_pool_release().

The previous free, used, or full chunk in sequence.

Referenced by mp_pool_get(), and mp_pool_release().

The pool that this chunk is part of.

Referenced by mp_pool_release().

First free item in the freelist for this chunk. Note that this may be NULL even if this chunk is not at capacity: if so, the free memory at next_mem has not yet been carved into items.

Referenced by mp_pool_get(), and mp_pool_release().

Number of currently allocated items in this chunk.

Referenced by mp_pool_get(), mp_pool_log_status(), and mp_pool_release().

Number of items that can be fit into this chunk.

Referenced by mp_pool_get(), and mp_pool_release().

Number of usable bytes in mem.

Referenced by mp_pool_get(), and mp_pool_log_status().

Pointer into part of mem not yet carved up.

Referenced by mp_pool_get(), and mp_pool_release().

char mp_chunk_t::mem[1]

Storage for this chunk. (Not actual size.)

Referenced by mp_pool_get(), and mp_pool_release().


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

Generated on Tue May 25 00:31:14 2010 for tor by  doxygen 1.5.6