GCC Middle and Back End API Reference
|
#include <vec.h>
Inherits vec< T, va_heap >.
Inherited by auto_delete_vec< node_t >, auto_delete_vec< edge_t >, auto_delete_vec< ana::bar_chart::item >, auto_delete_vec< ana::checker_event >, auto_delete_vec< ana::equiv_class >, auto_delete_vec< ana::saved_diagnostic >, auto_delete_vec< ana::state_machine >, auto_delete_vec< ana::sm_state_map >, auto_delete_vec< ana::svalue >, auto_delete_vec< ana::region >, auto_delete_vec< ana::pending_note >, auto_delete_vec< ana::state_machine::state >, auto_delete_vec< simple_diagnostic_thread >, auto_delete_vec< simple_diagnostic_event >, vector_builder< rtx, machine_mode, rtx_vector_builder >, vector_builder< tree, tree, tree_vector_builder >, and vector_builder< poly_int64, poly_uint64, int_vector_builder< poly_int64 > >.
Public Member Functions | |
auto_vec () | |
auto_vec (size_t s CXX_MEM_STAT_INFO) | |
~auto_vec () | |
vec< T, va_heap > | to_vec_legacy () |
Private Attributes | |
vec< T, va_heap, vl_embed > | m_auto |
unsigned char | m_data [sizeof(T) *N] |
Space efficient vector. These vectors can grow dynamically and are allocated together with their control data. They are suited to be included in data structures. Prior to initial allocation, they only take a single word of storage. These vectors are implemented as a pointer to an embeddable vector. The semantics allow for this pointer to be NULL to represent empty vectors. This way, empty vectors occupy minimal space in the structure containing them. Properties: - The whole vector and control data are allocated in a single contiguous block. - The whole vector may be re-allocated. - Vector data may grow and shrink. - Access and manipulation requires a pointer test and indirection. - It requires 1 word of storage (prior to vector allocation). Limitations: These vectors must be PODs because they are stored in unions. (http://en.wikipedia.org/wiki/Plain_old_data_structures). As long as we use C++03, we cannot have constructors nor destructors in classes that are stored in unions.
auto_vec is a subclass of vec that automatically manages creating and releasing the internal vector. If N is non zero then it has N elements of internal storage. The default is no internal storage, and you probably only want to ask for internal storage for vectors on the stack because if the size of the vector is larger than the internal storage that space is wasted.
References auto_vec< T, N >::m_auto, and N.
References auto_vec< T, N >::m_auto, N, and PASS_MEM_STAT.
Referenced by auto_vec< T, N >::auto_vec(), and auto_vec< T, N >::auto_vec().