GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

  • void *vec
  • int reserve
  • size_t vec_offset
  • size_t elt_size
  • MEM_STAT_DECL

実装[]

  94 /* As vec_gc_p_reserve, but for object vectors.  The vector's trailing
  95    array is at VEC_OFFSET offset and consists of ELT_SIZE sized
  96    elements.  */
97 
98 void *
99 vec_gc_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size
100                    MEM_STAT_DECL)
101 {
102   struct vec_prefix *pfx = vec;

*特に意味がない表記をしている様にみえる
**unsigned alloc = calculate_allocation (pfx, reserve);では駄目?

103   unsigned alloc = alloc = calculate_allocation (pfx, reserve);
104   
105   if (!alloc)
106     return NULL;
107   
108   vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT);
109   ((struct vec_prefix *)vec)->alloc = alloc;
110   if (!pfx)
111     ((struct vec_prefix *)vec)->num = 0;
112   
113   return vec;
114 }


リンク元

Advertisement