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>
602 unsigned allocated (
void)
const {
return m_vecpfx.m_alloc; }
603 unsigned length (
void)
const {
return m_vecpfx.m_num; }
604 bool is_empty (
void)
const {
return m_vecpfx.m_num == 0; }
605 T *
address (
void) {
return reinterpret_cast <T *
> (
this + 1); }
607 {
return reinterpret_cast <const T *
> (
this + 1); }
609 const T *
begin ()
const {
return address (); }
610 T *
end () {
return address () + length (); }
611 const T *
end ()
const {
return address () + length (); }
612 const T &operator[] (
unsigned)
const;
613 T &operator[] (
unsigned);
615 bool space (
unsigned)
const;
616 bool iterate (
unsigned, T *)
const;
617 bool iterate (
unsigned, T **)
const;
621 T *quick_push (
const T &);
623 =
typename std::conditional <std::is_trivially_destructible <T>::value,
626 void truncate (
unsigned);
627 void quick_insert (
unsigned,
const T &);
628 void ordered_remove (
unsigned);
629 void unordered_remove (
unsigned);
630 void block_remove (
unsigned,
unsigned);
631 void qsort (
int (*) (
const void *,
const void *));
632 void sort (
int (*) (
const void *,
const void *,
void *),
void *);
633 void stablesort (
int (*) (
const void *,
const void *,
void *),
void *);
634 T *bsearch (
const void *key,
int (*compar) (
const void *,
const void *));
635 T *bsearch (
const void *key,
636 int (*compar)(
const void *,
const void *,
void *),
void *);
637 unsigned lower_bound (
const T &,
bool (*) (
const T &,
const T &))
const;
638 bool contains (
const T &search)
const;
639 static size_t embedded_size (
unsigned);
640 void embedded_init (
unsigned,
unsigned = 0,
unsigned = 0);
641 void quick_grow (
unsigned len);
642 void quick_grow_cleared (
unsigned len);
645 template <
typename,
typename,
typename>
friend struct vec;
674template<
typename T,
typename A>
678 return v ? v->space (nelems) : nelems == 0;
683template<
typename T,
typename A>
687 return v ? v->length () : 0;
692template<
typename T,
typename A>
696 return v ? v->address () :
NULL;
701template<
typename T,
typename A>
705 return v ? v->is_empty () :
true;
710template<
typename T,
typename A>
721template<
typename T,
typename A>
733template<
typename T,
typename A>
744template<
typename T,
typename A>
753template<
typename T,
typename A>
766template<
typename T,
typename A>
774 v->quick_grow_cleared (len);
796 return v->reserve (nelems, exact);
801template<
typename T,
typename A>
806 return v->iterate (ix, ptr);
814template<
typename T,
typename A>
819 return v->iterate (ix, ptr);
830template<
typename T,
typename A>
835 return v->quick_push (obj);
841template<
typename T,
typename A>
847 v->quick_insert (ix, obj);
852template<
typename T,
typename A>
862template<
typename T,
typename A>
871template<
typename T,
typename A>
888template<
typename T,
typename A>
892 return v ? v->contains (search) :
false;
898template<
typename T,
typename A>
903 return address ()[ix];
906template<
typename T,
typename A>
911 return address ()[ix];
917template<
typename T,
typename A>
922 return (*
this)[m_vecpfx.m_num - 1];
932template<
typename T,
typename A>
936 return m_vecpfx.m_alloc - m_vecpfx.m_num >= nelems;
947template<
typename T,
typename A>
951 if (ix < m_vecpfx.m_num)
953 *ptr = address ()[ix];
973template<
typename T,
typename A>
977 if (ix < m_vecpfx.m_num)
992template<
typename T,
typename A>
997 unsigned len = length ();
1001 new_vec->embedded_init (len, len);
1011template<
typename T,
typename A>
1015 unsigned len = src.length ();
1020 m_vecpfx.m_num += len;
1024template<
typename T,
typename A>
1037template<
typename T,
typename A>
1042 T *
slot = &address ()[m_vecpfx.m_num++];
1043 ::new (
static_cast<void*
>(
slot))
T (obj);
1052template<
typename T,
typename A>
1057 T &
last = address ()[--m_vecpfx.m_num];
1058 if (!std::is_trivially_destructible <T>::value)
1067template<
typename T,
typename A>
1071 unsigned l = length ();
1073 if (!std::is_trivially_destructible <T>::value)
1075 m_vecpfx.m_num = size;
1083template<
typename T,
typename A>
1089#if GCC_VERSION >= 5000
1093 static_assert (std::is_trivially_copyable <T>::value,
"");
1095 T *
slot = &address ()[ix];
1096 memmove (
slot + 1,
slot, (m_vecpfx.m_num++ - ix) * sizeof (T));
1105template<
typename T,
typename A>
1110#if GCC_VERSION >= 5000
1111 static_assert (std::is_trivially_copyable <T>::value,
"");
1113 T *
slot = &address ()[ix];
1114 memmove (
slot,
slot + 1, (--m_vecpfx.m_num - ix) * sizeof (T));
1121#define VEC_ORDERED_REMOVE_IF_FROM_TO(vec, read_index, write_index, \
1122 elem_ptr, start, end, cond) \
1124 gcc_assert ((end) <= (vec).length ()); \
1125 for (read_index = write_index = (start); read_index < (end); \
1128 elem_ptr = &(vec)[read_index]; \
1129 bool remove_p = (cond); \
1133 if (read_index != write_index) \
1134 (vec)[write_index] = (vec)[read_index]; \
1139 if (read_index - write_index > 0) \
1140 (vec).block_remove (write_index, read_index - write_index); \
1147#define VEC_ORDERED_REMOVE_IF(vec, read_index, write_index, elem_ptr, \
1149 VEC_ORDERED_REMOVE_IF_FROM_TO ((vec), read_index, write_index, \
1150 elem_ptr, 0, (vec).length (), (cond))
1155template<
typename T,
typename A>
1160#if GCC_VERSION >= 5000
1161 static_assert (std::is_trivially_copyable <T>::value,
"");
1164 p[ix] = p[--m_vecpfx.m_num];
1171template<
typename T,
typename A>
1176#if GCC_VERSION >= 5000
1177 static_assert (std::is_trivially_copyable <T>::value,
"");
1179 T *
slot = &address ()[ix];
1180 m_vecpfx.m_num -= len;
1181 memmove (
slot,
slot + len, (m_vecpfx.m_num - ix) * sizeof (T));
1185#if GCC_VERSION >= 5000
1196 template<
typename T>
1197 struct is_trivially_copyable_or_pair : std::is_trivially_copyable<T> { };
1199 template<
typename T,
typename U>
1200 struct is_trivially_copyable_or_pair<std::
pair<T, U> >
1201 : std::integral_constant<bool, std::is_trivially_copyable<T>::value
1202 && std::is_trivially_copyable<U>::value> { };
1209template<
typename T,
typename A>
1213#if GCC_VERSION >= 5000
1214 static_assert (vec_detail::is_trivially_copyable_or_pair <T>::value,
"");
1217 gcc_qsort (address (), length (),
sizeof (T), cmp);
1223template<
typename T,
typename A>
1228#if GCC_VERSION >= 5000
1229 static_assert (vec_detail::is_trivially_copyable_or_pair <T>::value,
"");
1238template<
typename T,
typename A>
1241 void *),
void *
data)
1243#if GCC_VERSION >= 5000
1244 static_assert (vec_detail::is_trivially_copyable_or_pair <T>::value,
"");
1253template<
typename T,
typename A>
1256 int (*compar) (
const void *,
const void *))
1258 const void *base = this->address ();
1259 size_t nmemb = this->length ();
1260 size_t size =
sizeof (
T);
1271 p = (
const void *) (((
const char *) base) + (idx * size));
1278 return (T *)
const_cast<void *
>(p);
1287template<
typename T,
typename A>
1290 int (*compar) (
const void *,
const void *,
1291 void *),
void *
data)
1293 const void *base = this->address ();
1294 size_t nmemb = this->length ();
1295 size_t size =
sizeof (
T);
1306 p = (
const void *) (((
const char *) base) + (idx * size));
1313 return (T *)
const_cast<void *
>(p);
1322template<
typename T,
typename A>
1326 unsigned int len = length ();
1327 const T *p = address ();
1328 for (
unsigned int i = 0;
i < len;
i++)
1330 const T *
slot = &p[
i];
1331 if (*
slot == search)
1343template<
typename T,
typename A>
1346 bool (*lessthan)(
const T &,
const T &))
1349 unsigned int len = length ();
1350 unsigned int half, middle;
1351 unsigned int first = 0;
1357 const T &middle_elem = address ()[middle];
1358 if (lessthan (middle_elem, obj))
1362 len = len - half - 1;
1383template<
typename T,
typename A>
1387 struct alignas (T) U {
char data[
sizeof (
T)]; };
1389 typedef typename std::conditional<std::is_standard_layout<T>::value,
1391 static_assert (
sizeof (vec_stdlayout) ==
sizeof (
vec),
"");
1392 static_assert (
alignof (vec_stdlayout) ==
alignof (
vec),
"");
1393 return sizeof (vec_stdlayout) + alloc *
sizeof (T);
1400template<
typename T,
typename A>
1404 m_vecpfx.m_alloc = alloc;
1405 m_vecpfx.m_using_auto_storage = aut;
1406 m_vecpfx.m_num = num;
1413template<
typename T,
typename A>
1418#if GCC_VERSION >= 5000
1419 static_assert (std::is_trivially_default_constructible <T>::value,
"");
1421 m_vecpfx.m_num = len;
1428template<
typename T,
typename A>
1432 unsigned oldlen = length ();
1433 size_t growby = len - oldlen;
1435 m_vecpfx.m_num = len;
1446 static_assert (std::is_trivially_destructible <T>::value,
"");
1448 for (
unsigned i = 0;
i < v->length ();
i++)
1456 static_assert (std::is_trivially_destructible <T>::value,
"");
1464template<
typename T,
typename A>
1469 for (
unsigned i = 0;
i < v->length ();
i++)
1480template<
typename T,
typename A>
1484 for (
unsigned i = 0;
i < v->length ();
i++)
1485 op (&((*v)[
i]),
NULL, cookie);
1488template<
typename T,
typename A>
1493 for (
unsigned i = 0;
i < v->length ();
i++)
1533template<
typename T,
size_t N = 0>
1564 void release (
void);
1568 {
return m_vec !=
NULL; }
1571 {
return m_vec ? m_vec->is_empty () :
true; }
1574 {
return m_vec ? m_vec->allocated () : 0; }
1577 {
return m_vec ? m_vec->length () : 0; }
1580 {
return m_vec ? m_vec->address () :
NULL; }
1583 {
return m_vec ? m_vec->address () :
NULL; }
1586 const T *
begin ()
const {
return address (); }
1589 const T &operator[] (
unsigned ix)
const
1590 {
return (*m_vec)[ix]; }
1593 {
return !(*
this == other); }
1596 {
return address () == other.address (); }
1598 T &operator[] (
unsigned ix)
1599 {
return (*m_vec)[ix]; }
1602 {
return m_vec->last (); }
1605 {
return m_vec ? m_vec->space (nelems) : nelems == 0; }
1607 bool iterate (
unsigned ix, T *p)
const;
1608 bool iterate (
unsigned ix, T **p)
const;
1612 void splice (
const vec &);
1614 T *quick_push (
const T &);
1617 =
typename std::conditional <std::is_trivially_destructible <T>::value,
1620 void truncate (
unsigned);
1623 void quick_grow (
unsigned);
1624 void quick_grow_cleared (
unsigned);
1625 void quick_insert (
unsigned,
const T &);
1627 void ordered_remove (
unsigned);
1628 void unordered_remove (
unsigned);
1629 void block_remove (
unsigned,
unsigned);
1630 void qsort (
int (*) (
const void *,
const void *));
1631 void sort (
int (*) (
const void *,
const void *,
void *),
void *);
1632 void stablesort (
int (*) (
const void *,
const void *,
void *),
void *);
1633 T *bsearch (
const void *key,
int (*compar)(
const void *,
const void *));
1634 T *bsearch (
const void *key,
1635 int (*compar)(
const void *,
const void *,
void *),
void *);
1636 unsigned lower_bound (T,
bool (*)(
const T &,
const T &))
const;
1637 bool contains (
const T &search)
const;
1638 void reverse (
void);
1640 bool using_auto_storage ()
const;
1654template<
typename T,
size_t N >
1660 m_auto.embedded_init (
N, 0, 1);
1666 size_t off = (
char *) &
m_auto - (
char *)
this;
1678 m_auto.embedded_init (
N, 0, 1);
1680 size_t off = (
char *) &
m_auto - (
char *)
this;
1715 this->m_vec =
r.m_vec;
1722 this->m_vec =
r.m_vec;
1733 this->m_vec =
r.m_vec;
1745 this->m_vec =
r.m_vec;
1800template <
typename T>
1851 return m_vec->iterate (ix, ptr);
1874 return m_vec->iterate (ix, ptr);
1884#define FOR_EACH_VEC_ELT(V, I, P) \
1885 for (I = 0; (V).iterate ((I), &(P)); ++(I))
1887#define FOR_EACH_VEC_SAFE_ELT(V, I, P) \
1888 for (I = 0; vec_safe_iterate ((V), (I), &(P)); ++(I))
1891#define FOR_EACH_VEC_ELT_FROM(V, I, P, FROM) \
1892 for (I = (FROM); (V).iterate ((I), &(P)); ++(I))
1895#define FOR_EACH_VEC_ELT_REVERSE(V, I, P) \
1896 for (I = (V).length () - 1; \
1897 (V).iterate ((I), &(P)); \
1900#define FOR_EACH_VEC_SAFE_ELT_REVERSE(V, I, P) \
1901 for (I = vec_safe_length (V) - 1; \
1902 vec_safe_iterate ((V), (I), &(P)); \
1920template <
typename T>
1964 unsigned int oldsize = 0;
1965 bool handle_auto_vec = m_vec && using_auto_storage ();
1966 if (handle_auto_vec)
1969 oldsize = oldvec->length ();
1974 if (handle_auto_vec)
1977 m_vec->m_vecpfx.m_num = oldsize;
2021 if (using_auto_storage ())
2023 m_vec->m_vecpfx.m_num = 0;
2040 m_vec->splice (*(src.m_vec));
2056 reserve_exact (src.length ());
2070 return m_vec->quick_push (obj);
2083 return quick_push (obj);
2095 return m_vec->pop ();
2107 m_vec->truncate (size);
2121 unsigned oldlen = length ();
2125 m_vec->quick_grow (len);
2140 unsigned oldlen = length ();
2144 m_vec->quick_grow_cleared (len);
2158 m_vec->quick_grow (len);
2171 m_vec->quick_grow_cleared (len);
2182 m_vec->quick_insert (ix, obj);
2194 quick_insert (ix, obj);
2206 m_vec->ordered_remove (ix);
2217 m_vec->unordered_remove (ix);
2228 m_vec->block_remove (ix, len);
2249 void *),
void *
data)
2252 m_vec->sort (cmp,
data);
2261 void *),
void *
data)
2264 m_vec->stablesort (cmp,
data);
2273 int (*cmp) (
const void *,
const void *))
2276 return m_vec->bsearch (key, cmp);
2286 int (*cmp) (
const void *,
const void *,
2287 void *),
void *
data)
2290 return m_vec->bsearch (key, cmp,
data);
2303 bool (*lessthan)(
const T &,
const T &))
2306 return m_vec ? m_vec->lower_bound (obj, lessthan) : 0;
2316 return m_vec ? m_vec->contains (search) :
false;
2325 unsigned l = length ();
2326 T *ptr = address ();
2328 for (
unsigned i = 0;
i < l / 2;
i++)
2329 std::swap (ptr[
i], ptr[l -
i - 1]);
2336 return m_vec ? m_vec->m_vecpfx.m_using_auto_storage :
false;
2345 for (
unsigned i = 0;
i <
vec.length ();
i++)
2372 template<
typename OtherT>
2382 template<
typename OtherT>
2386 template<
typename OtherT>
2390 template<
typename OtherT,
typename A>
2392 :
m_base (v ? v->address () : nullptr),
m_size (v ? v->length () : 0) {}
2394 template<
typename OtherT,
typename A>
2396 :
m_base (v ? v->address () : nullptr),
m_size (v ? v->length () : 0) {}
2483#if (GCC_VERSION >= 3000)
2484# pragma GCC poison m_vec m_vecpfx m_vecdata
static void debug_slim(edge e)
Definition cfg.cc:584
array_slice()
Definition vec.h:2370
T value_type
Definition vec.h:2366
array_slice(vec< OtherT > &v)
Definition vec.h:2387
array_slice(const vec< OtherT > &v)
Definition vec.h:2383
unsigned int m_size
Definition vec.h:2425
const value_type & back() const
Definition vec.h:2454
friend class array_slice
Definition vec.h:2363
static array_slice invalid()
Definition vec.h:2418
const T * const_iterator
Definition vec.h:2368
const value_type & front() const
Definition vec.h:2438
array_slice(iterator base, unsigned int size)
Definition vec.h:2376
value_type & back()
Definition vec.h:2446
array_slice(const vec< OtherT, A, vl_embed > *v)
Definition vec.h:2391
iterator m_base
Definition vec.h:2424
unsigned size() const
Definition vec.h:2412
value_type & front()
Definition vec.h:2430
const_iterator end() const
Definition vec.h:2402
size_t size_bytes() const
Definition vec.h:2413
iterator begin()
Definition vec.h:2398
bool empty() const
Definition vec.h:2414
value_type & operator[](unsigned int i)
Definition vec.h:2462
array_slice(T(&array)[N])
Definition vec.h:2380
array_slice(array_slice< OtherT > other)
Definition vec.h:2373
iterator end()
Definition vec.h:2399
array_slice(vec< OtherT, A, vl_embed > *v)
Definition vec.h:2395
T * iterator
Definition vec.h:2367
bool is_valid() const
Definition vec.h:2421
const_iterator begin() const
Definition vec.h:2401
~auto_delete_vec()
Definition vec.h:1922
DISABLE_COPY_AND_ASSIGN(auto_delete_vec)
auto_delete_vec(size_t s)
Definition vec.h:1805
auto_delete_vec()
Definition vec.h:1804
~auto_string_vec()
Definition vec.h:1909
auto_vec(size_t n CXX_MEM_STAT_INFO)
Definition vec.h:1709
auto_vec(vec< T, va_heap > &&r)
Definition vec.h:1712
vec< T, va_heap > to_vec_legacy()
Definition vec.h:1754
auto_vec(auto_vec< T > &&r)
Definition vec.h:1719
auto_vec(const auto_vec &)=delete
~auto_vec()
Definition vec.h:1710
auto_vec()
Definition vec.h:1708
vec< T, va_heap, vl_embed > m_auto
Definition vec.h:1698
auto_vec()
Definition vec.h:1658
vec< T, va_heap > to_vec_legacy()
Definition vec.h:1693
~auto_vec()
Definition vec.h:1684
auto_vec(size_t s CXX_MEM_STAT_INFO)
Definition vec.h:1670
unsigned char m_data[sizeof(T) *N]
Definition vec.h:1699
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:472
static bool contains(const rtx_insn *, hash_table< insn_cache_hasher > *)
Definition function.cc:5720
static type_p type(options_p *optsp, bool nested)
Definition gengtype-parse.cc:883
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 ipa-prop.h:204
Definition gengtype.h:218
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 * end()
Definition vec.h:610
T * address(void)
Definition vec.h:605
vec * copy(ALONE_CXX_MEM_STAT_INFO) const
Definition vec.h:994
unsigned length(void) const
Definition vec.h:603
const T * end() const
Definition vec.h:611
T * begin()
Definition vec.h:608
void splice(const vec *src)
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:622
bool is_empty(void) const
Definition vec.h:604
const T * begin() const
Definition vec.h:609
unsigned allocated(void) const
Definition vec.h:602
bool space(int nelems) const
Definition vec.h:1604
const T * end() const
Definition vec.h:1588
vec(auto_vec< T, N > &)=delete
bool is_empty(void) const
Definition vec.h:1570
T * end()
Definition vec.h:1587
bool operator==(const vec &other) const
Definition vec.h:1595
unsigned allocated(void) const
Definition vec.h:1573
typename std::conditional< std::is_trivially_destructible< T >::value, T &, void >::type pop_ret_type
Definition vec.h:1616
T * begin()
Definition vec.h:1585
bool operator!=(const vec &other) const
Definition vec.h:1592
const T * begin() const
Definition vec.h:1586
bool exists(void) const
Definition vec.h:1567
unsigned length(void) const
Definition vec.h:1576
T * address(void)
Definition vec.h:1579
const T * address(void) const
Definition vec.h:1582
vec(vnull)
Definition vec.h:1546
T & last(void)
Definition vec.h:1601
unsigned m_num
Definition vec.h:245
unsigned m_using_auto_storage
Definition vec.h:244
unsigned m_alloc
Definition vec.h:243
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
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:821
#define qsort(...)
Definition system.h:1264
#define CONST_CAST(TYPE, X)
Definition system.h:1200
#define gcc_checking_assert(EXPR)
Definition system.h:828
#define MAX(X, Y)
Definition system.h:393
void * ggc_realloc(void *, size_t MEM_STAT_DECL)
#define FOR_EACH_VEC_ELT(V, I, P)
Definition vec.h:1884
T * vec_safe_address(vec< T, A, vl_embed > *v)
Definition vec.h:694
bool vec_safe_iterate(const vec< T, A, vl_embed > *v, unsigned ix, T **ptr)
Definition vec.h:803
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:42
void vec_safe_truncate(vec< T, A, vl_embed > *v, unsigned size)
Definition vec.h:854
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:1444
T * vec_safe_push(vec< T, A, vl_embed > *&v, const T &obj CXX_MEM_STAT_INFO)
Definition vec.h:832
void vec_check_alloc(vec< T, va_heap > *&vec, unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:1817
void dump_vec_loc_statistics(void)
Definition vec.cc:174
bool vec_safe_is_empty(vec< T, A, vl_embed > *v)
Definition vec.h:703
unsigned vec_safe_length(const vec< T, A, vl_embed > *v)
Definition vec.h:685
void gt_pch_nx(vec< T, A, vl_embed > *v)
Definition vec.h:1466
vec< T, A, vl_embed > * vec_safe_copy(vec< T, A, vl_embed > *src CXX_MEM_STAT_INFO)
Definition vec.h:864
bool vec_safe_contains(vec< T, A, vl_embed > *v, const T &search)
Definition vec.h:890
bool vec_safe_reserve(vec< T, A, vl_embed > *&v, unsigned nelems, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:712
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:2478
void release_vec_vec(vec< vec< T > > &vec)
Definition vec.h:2343
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:843
bool vec_safe_space(const vec< T, A, vl_embed > *v, unsigned nelems)
Definition vec.h:676
void vec_safe_grow(vec< T, A, vl_embed > *&v, unsigned len, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:755
void vec_safe_grow_cleared(vec< T, A, vl_embed > *&v, unsigned len, bool exact=false CXX_MEM_STAT_INFO)
Definition vec.h:768
void vec_alloc(vec< T, A, vl_embed > *&v, unsigned nelems CXX_MEM_STAT_INFO)
Definition vec.h:735
void vec_safe_splice(vec< T, A, vl_embed > *&dst, const vec< T, A, vl_embed > *src CXX_MEM_STAT_INFO)
Definition vec.h:873
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:723
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:746