GCC Middle and Back End API Reference
|
#include <vec.h>
Public Types | |
typedef vl_ptr | default_layout |
Public Member Functions | |
template<typename T > | |
void | reserve (vec< T, va_stack, vl_embed > *&v, unsigned nelems, bool exact MEM_STAT_DECL) |
Static Public Member Functions | |
template<typename T > | |
static void | alloc (vec< T, va_stack, vl_ptr > &, unsigned, vec< T, va_stack, vl_embed > *) |
template<typename T > | |
static void | reserve (vec< T, va_stack, vl_embed > *&, unsigned, bool CXX_MEM_STAT_INFO) |
template<typename T > | |
static void | release (vec< T, va_stack, vl_embed > *&) |
Allocator type for stack vectors.
typedef vl_ptr va_stack::default_layout |
|
static |
Allocate a vector V which uses alloca for the initial allocation. SPACE is space allocated using alloca. NELEMS is the number of entries allocated.
References register_stack_vec().
Referenced by vec< T, A, vl_embed >::embedded_init().
Free a vector allocated on the stack. Don't actually free it if we find it in the hash table.
References stack_vec_register_index(), and unregister_stack_vec().
Referenced by vec_free().
|
static |
Referenced by reserve(), and vec_safe_reserve().
void va_stack::reserve | ( | vec< T, va_stack, vl_embed > *& | v, |
unsigned | nelems, | ||
bool exact | MEM_STAT_DECL | ||
) |
Reserve NELEMS slots for a vector initially allocated on the stack. When this happens, we switch back to heap allocation. We remove the vector from stack_vecs, if it is there, since we no longer need to avoid freeing it. If EXACT is true, grow exactly, otherwise grow exponentially.
References memcpy(), reserve(), stack_vec_register_index(), T, and unregister_stack_vec().