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(), m_alloc, m_num, 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.

Referenced by calculate_allocation().

◆ register_overhead()

void vec_prefix::register_overhead ( void * ,
size_t ,
size_t CXX_MEM_STAT_INFO )
Account the overhead.

References FINAL_PASS_MEM_STAT, MEM_STAT_DECL, usage(), vec_mem_desc, and VEC_ORIGIN.

◆ 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, MEM_STAT_DECL, usage(), vec_mem_desc, and VEC_ORIGIN.

◆ va_gc

friend struct va_gc
friend

References va_gc.

Referenced by va_gc.

◆ va_gc_atomic

friend struct va_gc_atomic
friend

References va_gc_atomic.

Referenced by va_gc_atomic.

◆ va_heap

friend struct va_heap
friend

References va_heap.

Referenced by va_heap.

◆ vec

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

References vec.

Referenced by vec.

Field Documentation

◆ m_alloc

unsigned vec_prefix::m_alloc

Referenced by calculate_allocation().

◆ m_num

unsigned vec_prefix::m_num

Referenced by calculate_allocation().

◆ m_using_auto_storage

unsigned vec_prefix::m_using_auto_storage

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