GCC Middle and Back End API Reference
vec_prefix Struct Reference

#include <vec.h>

Public Member Functions

void register_overhead (void *, size_t, size_t CXX_MEM_STAT_INFO)
 
void release_overhead (void *, size_t, size_t, bool CXX_MEM_STAT_INFO)
 

Static Public Member Functions

static unsigned calculate_allocation (vec_prefix *, unsigned, bool)
 
static unsigned calculate_allocation_1 (unsigned, unsigned)
 

Data Fields

unsigned m_alloc: 31
 
unsigned m_using_auto_storage: 1
 
unsigned m_num
 

Friends

template<typename , typename , typename >
struct vec
 
struct va_gc
 
struct va_gc_atomic
 
struct va_heap
 

Detailed Description

Control data for vectors.  This contains the number of allocated
and used slots inside a vector.   

Member Function Documentation

◆ calculate_allocation()

unsigned vec_prefix::calculate_allocation ( vec_prefix * pfx,
unsigned reserve,
bool exact )
inlinestatic
Calculate the number of slots to reserve a vector, making sure that
RESERVE slots are free.  If EXACT grow exactly, otherwise grow
exponentially.  PFX is the control data for the vector.   

References calculate_allocation_1(), ggc_alloc(), and MAX.

Referenced by va_gc::reserve(), and va_heap::reserve().

◆ calculate_allocation_1()

unsigned vec_prefix::calculate_allocation_1 ( unsigned alloc,
unsigned desired )
static
Calculate the number of slots to reserve a vector, making sure that
it is of at least DESIRED size by growing ALLOC exponentially.   

References gcc_assert, and ggc_alloc().

Referenced by calculate_allocation().

◆ register_overhead()

void vec_prefix::register_overhead ( void * ,
size_t ,
size_t CXX_MEM_STAT_INFO )

◆ release_overhead()

void vec_prefix::release_overhead ( void * ,
size_t ,
size_t ,
bool CXX_MEM_STAT_INFO )
Notice that the memory allocated for the vector has been freed.   

References FINAL_PASS_MEM_STAT, ggc_alloc(), vec_usage::m_items, usage(), vec_mem_desc, and VEC_ORIGIN.

Friends And Related Symbol Documentation

◆ va_gc

◆ va_gc_atomic

◆ va_heap

◆ vec

template<typename , typename , typename >
friend struct vec
friend

Field Documentation

◆ m_alloc

unsigned vec_prefix::m_alloc

◆ m_num

unsigned vec_prefix::m_num

◆ m_using_auto_storage

unsigned vec_prefix::m_using_auto_storage

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