212 for ( ; n; ++dst, --n)
236 template <
typename,
typename,
typename>
friend struct vec;
257 return (pfx ? pfx->
m_num : 0) + reserve;
259 return MAX (4, reserve);
263template<
typename,
typename,
typename>
struct vec;
307 size_t elt_size =
sizeof (
T);
312 if (GATHER_STATISTICS && v)
313 v->m_vecpfx.release_overhead (v, elt_size * v->allocated (),
314 v->allocated (),
false);
317 unsigned nelem = v ? v->length () : 0;
319 v->embedded_init (alloc, nelem);
321 if (GATHER_STATISTICS)
322 v->m_vecpfx.register_overhead (v, alloc, elt_size
PASS_MEM_STAT);
326#if GCC_VERSION >= 4007
327#pragma GCC diagnostic push
328#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
337 size_t elt_size =
sizeof (
T);
341 if (!std::is_trivially_destructible <T>::value)
344 if (GATHER_STATISTICS)
345 v->m_vecpfx.release_overhead (v, elt_size * v->allocated (),
346 v->allocated (),
true);
351#if GCC_VERSION >= 4007
352#pragma GCC diagnostic pop
366 template<
typename T,
typename A>
370 template<
typename T,
typename A>
377template<
typename T,
typename A>
392template<
typename T,
typename A>
414 size_t elt_size =
sizeof (
T);
415 alloc = (size - vec_offset) / elt_size;
418 size = vec_offset + alloc * elt_size;
420 unsigned nelem = v ? v->length () : 0;
423 v->embedded_init (alloc, nelem);
448 typename L =
typename A::default_layout>
454template<
typename T,
typename A,
typename L>
456template<
typename T,
typename A,
typename L>
458template<
typename T,
typename A,
typename L>
460template<
typename T,
typename A,
typename L>
479 for (
i = 0;
i < ref.length (); ++
i)
481 fprintf (stderr,
"[%d] = ",
i);
483 fputc (
'\n', stderr);
497 for (
i = 0;
i < ref.length (); ++
i)
499 fprintf (stderr,
"[%d] = ",
i);
501 fputc (
'\n', stderr);
508#define DEFINE_DEBUG_VEC(T) \
509 template void debug_helper (vec<T> &); \
510 template void debug_helper (vec<T, va_gc> &); \
512 DEBUG_FUNCTION void \
513 debug (vec<T> &ref) \
515 debug_helper <T> (ref); \
517 DEBUG_FUNCTION void \
518 debug (vec<T> *ptr) \
523 fprintf (stderr, "<nil>\n"); \
526 DEBUG_FUNCTION void \
527 debug (vec<T, va_gc> &ref) \
529 debug_helper <T> (ref); \
531 DEBUG_FUNCTION void \
532 debug (vec<T, va_gc> *ptr) \
537 fprintf (stderr, "<nil>\n"); \
546 for ( ; n; ++dst, --n)
547 ::new (
static_cast<void*
>(dst))
T ();
556 for ( ; n; ++dst, ++src, --n)
557 ::new (
static_cast<void*
>(dst))
T (*src);
598template<
typename T,
typename A>
605 T *
address (
void) {
return reinterpret_cast <T *
> (
this + 1); }
607 {
return reinterpret_cast <const T *
> (
this + 1); }
612 const T &operator[] (
unsigned)
const;
613 T &operator[] (
unsigned);
614 const T &
last (
void)
const;
616 bool space (
unsigned)
const;
617 bool iterate (
unsigned,
T *)
const;
618 bool iterate (
unsigned,
T **)
const;
624 =
typename std::conditional <std::is_trivially_destructible <T>::value,
632 void qsort (
int (*) (
const void *,
const void *));
633 void sort (
int (*) (
const void *,
const void *,
void *),
void *);
634 void stablesort (
int (*) (
const void *,
const void *,
void *),
void *);
635 T *
bsearch (
const void *key,
int (*compar) (
const void *,
const void *));
637 int (*compar)(
const void *,
const void *,
void *),
void *);
638 unsigned lower_bound (
const T &,
bool (*) (
const T &,
const T &))
const;
646 template <
typename,
typename,
typename>
friend struct vec;
675template<
typename T,
typename A>
679 return v ? v->space (nelems) : nelems == 0;
684template<
typename T,
typename A>
688 return v ? v->length () : 0;
693template<
typename T,
typename A>
697 return v ? v->address () :
NULL;
702template<
typename T,
typename A>
706 return v ? v->is_empty () :
true;
711template<
typename T,
typename A>
722template<
typename T,
typename A>
734template<
typename T,
typename A>
745template<
typename T,
typename A>
754template<
typename T,
typename A>
767template<
typename T,
typename A>
775 v->quick_grow_cleared (len);
797 return v->reserve (nelems, exact);
802template<
typename T,
typename A>
807 return v->iterate (ix, ptr);
815template<
typename T,
typename A>
820 return v->iterate (ix, ptr);
831template<
typename T,
typename A>
836 return v->quick_push (obj);
842template<
typename T,
typename A>
848 v->quick_insert (ix, obj);
853template<
typename T,
typename A>
863template<
typename T,
typename A>
872template<
typename T,
typename A>
889template<
typename T,
typename A>
893 return v ? v->contains (search) :
false;
899template<
typename T,
typename A>
907template<
typename T,
typename A>
918template<
typename T,
typename A>
926template<
typename T,
typename A>
941template<
typename T,
typename A>
956template<
typename T,
typename A>
982template<
typename T,
typename A>
1001template<
typename T,
typename A>
1006 unsigned len =
length ();
1010 new_vec->embedded_init (len, len);
1020template<
typename T,
typename A>
1024 unsigned len = src.length ();
1029 m_vecpfx.m_num += len;
1033template<
typename T,
typename A>
1046template<
typename T,
typename A>
1052 ::new (
static_cast<void*
>(
slot))
T (obj);
1061template<
typename T,
typename A>
1067 if (!std::is_trivially_destructible <T>::value)
1076template<
typename T,
typename A>
1082 if (!std::is_trivially_destructible <T>::value)
1092template<
typename T,
typename A>
1098#if GCC_VERSION >= 5000
1102 static_assert (std::is_trivially_copyable <T>::value,
"");
1114template<
typename T,
typename A>
1119#if GCC_VERSION >= 5000
1120 static_assert (std::is_trivially_copyable <T>::value,
"");
1130#define VEC_ORDERED_REMOVE_IF_FROM_TO(vec, read_index, write_index, \
1131 elem_ptr, start, end, cond) \
1133 gcc_assert ((end) <= (vec).length ()); \
1134 for (read_index = write_index = (start); read_index < (end); \
1137 elem_ptr = &(vec)[read_index]; \
1138 bool remove_p = (cond); \
1142 if (read_index != write_index) \
1143 (vec)[write_index] = (vec)[read_index]; \
1148 if (read_index - write_index > 0) \
1149 (vec).block_remove (write_index, read_index - write_index); \
1156#define VEC_ORDERED_REMOVE_IF(vec, read_index, write_index, elem_ptr, \
1158 VEC_ORDERED_REMOVE_IF_FROM_TO ((vec), read_index, write_index, \
1159 elem_ptr, 0, (vec).length (), (cond))
1164template<
typename T,
typename A>
1169#if GCC_VERSION >= 5000
1170 static_assert (std::is_trivially_copyable <T>::value,
"");
1180template<
typename T,
typename A>
1185#if GCC_VERSION >= 5000
1186 static_assert (std::is_trivially_copyable <T>::value,
"");
1194#if GCC_VERSION >= 5000
1205 template<
typename T>
1206 struct is_trivially_copyable_or_pair : std::is_trivially_copyable<T> { };
1208 template<
typename T,
typename U>
1209 struct is_trivially_copyable_or_pair<std::pair<T, U> >
1210 : std::integral_constant<bool, std::is_trivially_copyable<T>::value
1211 && std::is_trivially_copyable<U>::value> { };
1218template<
typename T,
typename A>
1222#if GCC_VERSION >= 5000
1223 static_assert (vec_detail::is_trivially_copyable_or_pair <T>::value,
"");
1232template<
typename T,
typename A>
1237#if GCC_VERSION >= 5000
1238 static_assert (vec_detail::is_trivially_copyable_or_pair <T>::value,
"");
1247template<
typename T,
typename A>
1250 void *),
void *
data)
1252#if GCC_VERSION >= 5000
1253 static_assert (vec_detail::is_trivially_copyable_or_pair <T>::value,
"");
1262template<
typename T,
typename A>
1265 int (*compar) (
const void *,
const void *))
1267 const void *base = this->
address ();
1268 size_t nmemb = this->
length ();
1269 size_t size =
sizeof (
T);
1280 p = (
const void *) (((
const char *) base) + (idx * size));
1287 return (
T *)
const_cast<void *
>(p);
1296template<
typename T,
typename A>
1299 int (*compar) (
const void *,
const void *,
1300 void *),
void *
data)
1302 const void *base = this->
address ();
1303 size_t nmemb = this->
length ();
1304 size_t size =
sizeof (
T);
1315 p = (
const void *) (((
const char *) base) + (idx * size));
1322 return (
T *)
const_cast<void *
>(p);
1331template<
typename T,
typename A>
1335 unsigned int len =
length ();
1337 for (
unsigned int i = 0;
i < len;
i++)
1340 if (*
slot == search)
1352template<
typename T,
typename A>
1355 bool (*lessthan)(
const T &,
const T &))
1358 unsigned int len =
length ();
1359 unsigned int half, middle;
1360 unsigned int first = 0;
1366 const T &middle_elem =
address ()[middle];
1367 if (lessthan (middle_elem, obj))
1371 len = len - half - 1;
1392template<
typename T,
typename A>
1396 struct alignas (T) U {
char data[
sizeof (
T)]; };
1398 typedef typename std::conditional<std::is_standard_layout<T>::value,
1400 static_assert (
sizeof (vec_stdlayout) ==
sizeof (
vec),
"");
1401 static_assert (
alignof (vec_stdlayout) ==
alignof (
vec),
"");
1402 return sizeof (vec_stdlayout) + alloc *
sizeof (
T);
1409template<
typename T,
typename A>
1414 m_vecpfx.m_using_auto_storage = aut;
1422template<
typename T,
typename A>
1427#if GCC_VERSION >= 5000
1428 static_assert (std::is_trivially_default_constructible <T>::value,
"");
1437template<
typename T,
typename A>
1441 unsigned oldlen =
length ();
1442 size_t growby = len - oldlen;
1455 static_assert (std::is_trivially_destructible <T>::value,
"");
1457 for (
unsigned i = 0;
i < v->length ();
i++)
1465 static_assert (std::is_trivially_destructible <T>::value,
"");
1473template<
typename T,
typename A>
1478 for (
unsigned i = 0;
i < v->length ();
i++)
1489template<
typename T,
typename A>
1493 for (
unsigned i = 0;
i < v->length ();
i++)
1494 op (&((*v)[
i]),
NULL, cookie);
1497template<
typename T,
typename A>
1502 for (
unsigned i = 0;
i < v->length ();
i++)
1542template<
typename T,
size_t N = 0>
1580 {
return m_vec ?
m_vec->is_empty () :
true; }
1598 const T &operator[] (
unsigned ix)
const
1599 {
return (*
m_vec)[ix]; }
1601 {
return m_vec->last (); }
1604 {
return !(*
this == other); }
1607 {
return address () == other.address (); }
1609 T &operator[] (
unsigned ix)
1610 {
return (*
m_vec)[ix]; }
1613 {
return m_vec->last (); }
1616 {
return m_vec ?
m_vec->space (nelems) : nelems == 0; }
1618 bool iterate (
unsigned ix,
T *p)
const;
1619 bool iterate (
unsigned ix,
T **p)
const;
1623 void splice (
const vec &);
1625 T *quick_push (
const T &);
1628 =
typename std::conditional <std::is_trivially_destructible <T>::value,
1641 void qsort (
int (*) (
const void *,
const void *));
1642 void sort (
int (*) (
const void *,
const void *,
void *),
void *);
1643 void stablesort (
int (*) (
const void *,
const void *,
void *),
void *);
1644 T *
bsearch (
const void *key,
int (*compar)(
const void *,
const void *));
1646 int (*compar)(
const void *,
const void *,
void *),
void *);
1665template<
typename T,
size_t N >
1671 m_auto.embedded_init (
N, 0, 1);
1677 size_t off = (
char *) &
m_auto - (
char *)
this;
1689 m_auto.embedded_init (
N, 0, 1);
1691 size_t off = (
char *) &
m_auto - (
char *)
this;
1726 this->m_vec =
r.m_vec;
1733 this->m_vec =
r.m_vec;
1744 this->m_vec =
r.m_vec;
1756 this->m_vec =
r.m_vec;
1811template <
typename T>
1862 return m_vec->iterate (ix, ptr);
1885 return m_vec->iterate (ix, ptr);
1895#define FOR_EACH_VEC_ELT(V, I, P) \
1896 for (I = 0; (V).iterate ((I), &(P)); ++(I))
1898#define FOR_EACH_VEC_SAFE_ELT(V, I, P) \
1899 for (I = 0; vec_safe_iterate ((V), (I), &(P)); ++(I))
1902#define FOR_EACH_VEC_ELT_FROM(V, I, P, FROM) \
1903 for (I = (FROM); (V).iterate ((I), &(P)); ++(I))
1906#define FOR_EACH_VEC_ELT_REVERSE(V, I, P) \
1907 for (I = (V).length () - 1; \
1908 (V).iterate ((I), &(P)); \
1911#define FOR_EACH_VEC_SAFE_ELT_REVERSE(V, I, P) \
1912 for (I = vec_safe_length (V) - 1; \
1913 vec_safe_iterate ((V), (I), &(P)); \
1931template <
typename T>
1975 unsigned int oldsize = 0;
1977 if (handle_auto_vec)
1980 oldsize = oldvec->length ();
1985 if (handle_auto_vec)
1988 m_vec->m_vecpfx.m_num = oldsize;
2034 m_vec->truncate (0);
2051 m_vec->splice (*(src.m_vec));
2081 return m_vec->quick_push (obj);
2106 return m_vec->pop ();
2118 m_vec->truncate (size);
2132 unsigned oldlen =
length ();
2136 m_vec->quick_grow (len);
2151 unsigned oldlen =
length ();
2155 m_vec->quick_grow_cleared (len);
2169 m_vec->quick_grow (len);
2182 m_vec->quick_grow_cleared (len);
2193 m_vec->quick_insert (ix, obj);
2217 m_vec->ordered_remove (ix);
2228 m_vec->unordered_remove (ix);
2239 m_vec->block_remove (ix, len);
2260 void *),
void *
data)
2272 void *),
void *
data)
2284 int (*cmp) (
const void *,
const void *))
2287 return m_vec->bsearch (key, cmp);
2297 int (*cmp) (
const void *,
const void *,
2298 void *),
void *
data)
2314 bool (*lessthan)(
const T &,
const T &))
2317 return m_vec ?
m_vec->lower_bound (obj, lessthan) : 0;
2327 return m_vec ?
m_vec->contains (search) :
false;
2339 for (
unsigned i = 0;
i < l / 2;
i++)
2340 std::swap (ptr[
i], ptr[l -
i - 1]);
2347 return m_vec ?
m_vec->m_vecpfx.m_using_auto_storage :
false;
2356 for (
unsigned i = 0;
i <
vec.length ();
i++)
2383 template<
typename OtherT>
2393 template<
typename OtherT>
2397 template<
typename OtherT>
2401 template<
typename OtherT,
typename A>
2403 :
m_base (v ? v->address () : nullptr),
m_size (v ? v->length () : 0) {}
2405 template<
typename OtherT,
typename A>
2407 :
m_base (v ? v->address () : nullptr),
m_size (v ? v->length () : 0) {}
2494#if (GCC_VERSION >= 3000)
2495# pragma GCC poison m_vec m_vecpfx m_vecdata
void gt_pch_nx(bbitmap< N > *)
Definition bbitmap.h:226
void gt_ggc_mx(bbitmap< N > *)
Definition bbitmap.h:220
static void debug_slim(edge e)
Definition cfg.cc:584
array_slice()
Definition vec.h:2381
T value_type
Definition vec.h:2377
array_slice(vec< OtherT > &v)
Definition vec.h:2398
array_slice(const vec< OtherT > &v)
Definition vec.h:2394
unsigned int m_size
Definition vec.h:2436
const value_type & back() const
Definition vec.h:2465
friend class array_slice
Definition vec.h:2374
static array_slice invalid()
Definition vec.h:2429
const T * const_iterator
Definition vec.h:2379
const value_type & front() const
Definition vec.h:2449
array_slice(iterator base, unsigned int size)
Definition vec.h:2387
value_type & back()
Definition vec.h:2457
array_slice(const vec< OtherT, A, vl_embed > *v)
Definition vec.h:2402
iterator m_base
Definition vec.h:2435
unsigned size() const
Definition vec.h:2423
value_type & front()
Definition vec.h:2441
const_iterator end() const
Definition vec.h:2413
size_t size_bytes() const
Definition vec.h:2424
iterator begin()
Definition vec.h:2409
bool empty() const
Definition vec.h:2425
value_type & operator[](unsigned int i)
Definition vec.h:2473
array_slice(T(&array)[N])
Definition vec.h:2391
array_slice(array_slice< OtherT > other)
Definition vec.h:2384
iterator end()
Definition vec.h:2410
array_slice(vec< OtherT, A, vl_embed > *v)
Definition vec.h:2406
T * iterator
Definition vec.h:2378
bool is_valid() const
Definition vec.h:2432
const_iterator begin() const
Definition vec.h:2412
~auto_delete_vec()
Definition vec.h:1933
DISABLE_COPY_AND_ASSIGN(auto_delete_vec)
auto_delete_vec(size_t s)
Definition vec.h:1816
auto_delete_vec()
Definition vec.h:1815
~auto_string_vec()
Definition vec.h:1920
auto_vec(size_t n CXX_MEM_STAT_INFO)
Definition vec.h:1720
auto_vec(vec< T, va_heap > &&r)
Definition vec.h:1723
vec< T, va_heap > to_vec_legacy()
Definition vec.h:1765
auto_vec(auto_vec< T > &&r)
Definition vec.h:1730
auto_vec(const auto_vec &)=delete
~auto_vec()
Definition vec.h:1721
auto_vec()
Definition vec.h:1719
vec< decl_lineno, va_heap, vl_embed > m_auto
Definition vec.h:1709
auto_vec()
Definition vec.h:1669
vec< T, va_heap > to_vec_legacy()
Definition vec.h:1704
~auto_vec()
Definition vec.h:1695
auto_vec(size_t s CXX_MEM_STAT_INFO)
Definition vec.h:1681
unsigned char m_data[sizeof(decl_lineno) *N]
Definition vec.h:1710
Definition genoutput.cc:150
Definition lra-spills.cc:101
#define GTY(x)
Definition coretypes.h:41
void(* gt_pointer_operator)(void *, void *, void *)
Definition coretypes.h:473
static bool contains(const rtx_insn *, hash_table< insn_cache_hasher > *)
Definition function.cc:5776
static struct token T
Definition gengtype-parse.cc:45
static struct filedep ** last
Definition genmddeps.cc:33
#define N
Definition gensupport.cc:202
poly_int< N, C > r
Definition poly-int.h:774
i
Definition poly-int.h:776
void gcc_stablesort_r(void *vbase, size_t n, size_t size, sort_r_cmp_fn *cmp, void *data)
Definition sort.cc:309
void gcc_qsort(void *vbase, size_t n, size_t size, cmp_fn *cmp)
Definition sort.cc:255
void gcc_sort_r(void *vbase, size_t n, size_t size, sort_r_cmp_fn *cmp, void *data)
Definition sort.cc:279
#define ALONE_CXX_MEM_STAT_INFO
Definition statistics.h:57
#define ALONE_PASS_MEM_STAT
Definition statistics.h:49
#define PASS_MEM_STAT
Definition statistics.h:54
#define ALONE_MEM_STAT_DECL
Definition statistics.h:47
#define MEM_STAT_DECL
Definition statistics.h:52
#define CXX_MEM_STAT_INFO
Definition statistics.h:58
Definition compare-elim.cc:91
Definition gengtype.h:252
vl_embed default_layout
Definition vec.h:364
static void release(vec< T, A, vl_embed > *&v)
Definition vec.h:379
static void reserve(vec< T, A, vl_embed > *&, unsigned, bool CXX_MEM_STAT_INFO)
static void release(vec< T, va_heap, vl_embed > *&)
Definition vec.h:335
static void reserve(vec< T, va_heap, vl_embed > *&, unsigned, bool CXX_MEM_STAT_INFO)
vl_ptr default_layout
Definition vec.h:286
T * quick_push(const T &)
Definition vec.h:1048
void stablesort(int(*)(const void *, const void *, void *), void *)
Definition vec.h:1249
bool space(unsigned) const
Definition vec.h:943
T * end()
Definition vec.h:610
void ordered_remove(unsigned)
Definition vec.h:1116
T * address(void)
Definition vec.h:605
vec * copy(ALONE_CXX_MEM_STAT_INFO) const
Definition vec.h:1003
static size_t embedded_size(unsigned)
Definition vec.h:1394
vec_prefix m_vecpfx
Definition vec.h:655
pop_ret_type pop(void)
Definition vec.h:1063
unsigned length(void) const
Definition vec.h:603
void block_remove(unsigned, unsigned)
Definition vec.h:1182
void quick_grow(unsigned len)
Definition vec.h:1424
T * bsearch(const void *key, int(*compar)(const void *, const void *))
Definition vec.h:1264
friend struct va_heap
Definition vec.h:650
void unordered_remove(unsigned)
Definition vec.h:1166
const T * end() const
Definition vec.h:611
T * begin()
Definition vec.h:608
void splice(const vec *src)
void quick_insert(unsigned, const T &)
Definition vec.h:1094
friend struct va_gc_atomic
Definition vec.h:649
friend struct va_gc
Definition vec.h:648
void sort(int(*)(const void *, const void *, void *), void *)
Definition vec.h:1234
const T & last(void) const
Definition vec.h:920
void quick_grow_cleared(unsigned len)
Definition vec.h:1439
const T * address(void) const
Definition vec.h:606
typename std::conditional< std::is_trivially_destructible< T >::value, T &, void >::type pop_ret_type
Definition vec.h:623
bool is_empty(void) const
Definition vec.h:604
friend struct vec
Definition vec.h:645
const T * begin() const
Definition vec.h:609
unsigned allocated(void) const
Definition vec.h:602
void embedded_init(unsigned, unsigned=0, unsigned=0)
Definition vec.h:1411
unsigned lower_bound(const T &, bool(*)(const T &, const T &)) const
Definition vec.h:1354
void truncate(unsigned)
Definition vec.h:1078
bool space(int nelems) const
Definition vec.h:1615
const T * end() const
Definition vec.h:1597
vec(auto_vec< T, N > &)=delete
void safe_insert(unsigned, const T &CXX_MEM_STAT_INFO)
Definition vec.h:2202
bool is_empty(void) const
Definition vec.h:1579
vec< T, va_heap, vl_embed > * m_vec
Definition vec.h:1654
void quick_grow_cleared(unsigned)
Definition vec.h:2179
T * end()
Definition vec.h:1596
bool operator==(const vec &other) const
Definition vec.h:1606
void safe_grow_cleared(unsigned, bool=false CXX_MEM_STAT_INFO)
Definition vec.h:2148
T * bsearch(const void *key, int(*compar)(const void *, const void *))
Definition vec.h:2283
void ordered_remove(unsigned)
Definition vec.h:2215
const T & last(void) const
Definition vec.h:1600
T * quick_push(const T &)
Definition vec.h:2079
unsigned allocated(void) const
Definition vec.h:1582
void quick_insert(unsigned, const T &)
Definition vec.h:2191
bool using_auto_storage() const
Definition vec.h:2345
void quick_grow(unsigned)
Definition vec.h:2166
void reverse(void)
Definition vec.h:2334
typename std::conditional< std::is_trivially_destructible< T >::value, T &, void >::type pop_ret_type
Definition vec.h:1627
bool reserve_exact(unsigned CXX_MEM_STAT_INFO)
Definition vec.h:2002
T * begin()
Definition vec.h:1594
void block_remove(unsigned, unsigned)
Definition vec.h:2237
bool operator!=(const vec &other) const
Definition vec.h:1603
void unordered_remove(unsigned)
Definition vec.h:2226
bool reserve(unsigned, bool=false CXX_MEM_STAT_INFO)
Definition vec.h:1966
void create(unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:2015
void sort(int(*)(const void *, const void *, void *), void *)
Definition vec.h:2259
const T * begin() const
Definition vec.h:1595
bool exists(void) const
Definition vec.h:1576
void safe_grow(unsigned, bool=false CXX_MEM_STAT_INFO)
Definition vec.h:2130
void splice(const vec &)
Definition vec.h:2048
void truncate(unsigned)
Definition vec.h:2115
void stablesort(int(*)(const void *, const void *, void *), void *)
Definition vec.h:2271
void release(void)
Definition vec.h:2027
unsigned length(void) const
Definition vec.h:1585
T * address(void)
Definition vec.h:1588
pop_ret_type pop(void)
Definition vec.h:2104
const T * address(void) const
Definition vec.h:1591
vec(vnull)
Definition vec.h:1555
T & last(void)
Definition vec.h:1612
unsigned lower_bound(T, bool(*)(const T &, const T &)) const
Definition vec.h:2313
unsigned m_num
Definition vec.h:245
unsigned m_using_auto_storage
Definition vec.h:244
unsigned m_alloc
Definition vec.h:243
friend struct va_heap
Definition vec.h:241
void register_overhead(void *, size_t, size_t CXX_MEM_STAT_INFO)
Definition vec.cc:119
static unsigned calculate_allocation_1(unsigned, unsigned)
Definition vec.cc:150
friend struct va_gc_atomic
Definition vec.h:240
friend struct va_gc
Definition vec.h:239
friend struct vec
Definition vec.h:236
void release_overhead(void *, size_t, size_t, bool CXX_MEM_STAT_INFO)
Definition vec.cc:135
static unsigned calculate_allocation(vec_prefix *, unsigned, bool)
Definition vec.h:253
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814
#define qsort(...)
Definition system.h:1257
#define CONST_CAST(TYPE, X)
Definition system.h:1193
#define gcc_checking_assert(EXPR)
Definition system.h:821
#define MAX(X, Y)
Definition system.h:397
void * ggc_realloc(void *, size_t MEM_STAT_DECL)
#define FOR_EACH_VEC_ELT(V, I, P)
Definition vec.h:1895
T * vec_safe_address(vec< T, A, vl_embed > *v)
Definition vec.h:695
bool vec_safe_iterate(const vec< T, A, vl_embed > *v, unsigned ix, T **ptr)
Definition vec.h:804
T * end(vec< T, A, L > *v)
Definition vec.h:457
T * begin(vec< T, A, L > *v)
Definition vec.h:455
void ggc_free(void *)
Definition genmatch.cc:52
void vec_safe_truncate(vec< T, A, vl_embed > *v, unsigned size)
Definition vec.h:855
void vec_destruct(T *dst, unsigned n)
Definition vec.h:210
constexpr vnull vNULL
Definition vec.h:569
void gt_ggc_mx(vec< T, va_gc > *v)
Definition vec.h:1453
T * vec_safe_push(vec< T, A, vl_embed > *&v, const T &obj CXX_MEM_STAT_INFO)
Definition vec.h:833
void vec_check_alloc(vec< T, va_heap > *&vec, unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:1828
void dump_vec_loc_statistics(void)
Definition vec.cc:174
bool vec_safe_is_empty(vec< T, A, vl_embed > *v)
Definition vec.h:704
unsigned vec_safe_length(const vec< T, A, vl_embed > *v)
Definition vec.h:686
void gt_pch_nx(vec< T, A, vl_embed > *v)
Definition vec.h:1475
vec< T, A, vl_embed > * vec_safe_copy(vec< T, A, vl_embed > *src CXX_MEM_STAT_INFO)
Definition vec.h:865
bool vec_safe_contains(vec< T, A, vl_embed > *v, const T &search)
Definition vec.h:891
bool vec_safe_reserve(vec< T, A, vl_embed > *&v, unsigned nelems, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:713
void vec_default_construct(T *dst, unsigned n)
Definition vec.h:544
array_slice< T > make_array_slice(T *base, unsigned int size)
Definition vec.h:2489
void release_vec_vec(vec< vec< T > > &vec)
Definition vec.h:2354
size_t ggc_round_alloc_size(size_t requested_size)
Definition ggc-none.cc:38
void vec_safe_insert(vec< T, A, vl_embed > *&v, unsigned ix, const T &obj CXX_MEM_STAT_INFO)
Definition vec.h:844
bool vec_safe_space(const vec< T, A, vl_embed > *v, unsigned nelems)
Definition vec.h:677
void vec_safe_grow(vec< T, A, vl_embed > *&v, unsigned len, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:756
void vec_safe_grow_cleared(vec< T, A, vl_embed > *&v, unsigned len, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:769
void vec_alloc(vec< T, A, vl_embed > *&v, unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:736
void vec_safe_splice(vec< T, A, vl_embed > *&dst, const vec< T, A, vl_embed > *src CXX_MEM_STAT_INFO)
Definition vec.h:874
void debug_helper(vec< T > &ref)
Definition vec.h:476
bool vec_safe_reserve_exact(vec< T, A, vl_embed > *&v, unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:724
htab_t vec_mem_usage_hash
void vec_copy_construct(T *dst, const T *src, unsigned n)
Definition vec.h:554
void vec_free(vec< T, A, vl_embed > *&v)
Definition vec.h:747