GCC Middle and Back End API Reference
vec_prefix Struct Reference

#include <vec.h>

Public Member Functions

void register_overhead (size_t, const char *, int, const char *)
void release_overhead (void)

Static Public Member Functions

static unsigned calculate_allocation (vec_prefix *, unsigned, bool)

Data Fields

unsigned m_alloc: 31
unsigned m_has_auto_buf: 1
unsigned m_num


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

unsigned vec_prefix::calculate_allocation ( vec_prefix pfx,
unsigned  reserve,
bool  exact 
   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.  
       If there's no vector, and we've not requested anything, then we
       will create a NULL vector.  
     We must have run out of room.  
       Exact size.  
         Exponential growth. 
           Double when small.  
           Grow slower when large.  
         If this is still too small, set it to the right size. 
void vec_prefix::register_overhead ( size_t  size,
const char *  name,
int  line,
const char *  function 
     FIXME - These fields should be private, but we need to cater to
             compilers that have stricter notions of PODness for types.  
     Memory allocation support routines in vec.c.  
   Account the overhead.  
void vec_prefix::release_overhead ( void  )
   Notice that the memory allocated for the vector has been freed.  

References m_alloc, and m_num.

Friends And Related Function Documentation

friend struct va_gc
     The allocator types also need access to our internals.  
friend struct va_gc_atomic
friend struct va_heap
friend struct vec
     Note that vec_prefix should be a base class for vec, but we use
     offsetof() on vector fields of tree structures (e.g.,
     tree_binfo::base_binfos), and offsetof only supports base types.

     To compensate, we make vec_prefix a field inside vec and make
     vec a friend class of vec_prefix so it can access its fields.  

Field Documentation

unsigned vec_prefix::m_alloc

Referenced by release_overhead().

unsigned vec_prefix::m_has_auto_buf
unsigned vec_prefix::m_num

Referenced by release_overhead().

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