Tor  0.4.7.0-alpha-dev
Data Fields
memarea_chunk_t Struct Reference

Data Fields

struct memarea_chunk_tnext_chunk
 
size_t mem_size
 
char * next_mem
 
union {
   char   mem [1]
 
   void *   void_for_alignment_
 
u
 

Detailed Description

Implements part of a memarea. New memory is carved off from chunk->mem in increasing order until a request is too big, at which point a new chunk is allocated.

Definition at line 92 of file memarea.c.

Field Documentation

◆ mem

char mem[1]

Memory space in this chunk.

Definition at line 103 of file memarea.c.

◆ mem_size

size_t mem_size

How much RAM is available in mem, total?

Definition at line 95 of file memarea.c.

Referenced by memarea_alloc(), memarea_assert_ok(), and memarea_get_stats().

◆ next_chunk

struct memarea_chunk_t* next_chunk

Next chunk in this area. Only kept around so we can free it.

Definition at line 94 of file memarea.c.

Referenced by memarea_alloc(), memarea_assert_ok(), memarea_clear(), memarea_drop_all_(), memarea_get_stats(), and memarea_owns_ptr().

◆ next_mem

char* next_mem

Next position in mem to allocate data at. If it's equal to mem+mem_size, this chunk is full.

Definition at line 96 of file memarea.c.

Referenced by memarea_alloc(), memarea_assert_ok(), memarea_clear(), and memarea_get_stats().

◆ 

union { ... } u

Union used to enforce alignment when we don't have support for doing it right.

◆ void_for_alignment_

void* void_for_alignment_

Dummy; used to make sure mem is aligned.

Definition at line 104 of file memarea.c.


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