summaryrefslogtreecommitdiff
path: root/gcc/vec.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 09:27:48 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-30 09:27:48 +0000
commit279dc72feede56719335d771f23babe9330096a3 (patch)
treeff400275b8d7c6494715874e348b5de2b2f15faa /gcc/vec.c
parent744c2d412b76c9b2abc14176d120429d7207ad95 (diff)
downloadgcc-279dc72feede56719335d771f23babe9330096a3.tar.gz
2009-11-30 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 154750 (or near) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@154757 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/vec.c')
-rw-r--r--gcc/vec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/vec.c b/gcc/vec.c
index 3e60580992d..078bcc63653 100644
--- a/gcc/vec.c
+++ b/gcc/vec.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "hashtab.h"
-struct vec_prefix
+struct vec_prefix
{
unsigned num;
unsigned alloc;
@@ -190,10 +190,10 @@ calculate_allocation (const struct vec_prefix *pfx, int reserve, bool exact)
/* If there's no prefix, and we've not requested anything, then we
will create a NULL vector. */
return 0;
-
+
/* We must have run out of room. */
gcc_assert (alloc - num < (unsigned) reserve);
-
+
if (exact)
/* Exact size. */
alloc = num + reserve;
@@ -208,7 +208,7 @@ calculate_allocation (const struct vec_prefix *pfx, int reserve, bool exact)
else
/* Grow slower when large. */
alloc = (alloc * 3 / 2);
-
+
/* If this is still too small, set it to the right size. */
if (alloc < num + reserve)
alloc = num + reserve;
@@ -228,19 +228,19 @@ vec_gc_o_reserve_1 (void *vec, int reserve, size_t vec_offset, size_t elt_size,
{
struct vec_prefix *pfx = (struct vec_prefix *) vec;
unsigned alloc = calculate_allocation (pfx, reserve, exact);
-
+
if (!alloc)
{
if (pfx)
ggc_free (pfx);
return NULL;
}
-
+
vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT);
((struct vec_prefix *)vec)->alloc = alloc;
if (!pfx)
((struct vec_prefix *)vec)->num = 0;
-
+
return vec;
}
@@ -316,7 +316,7 @@ vec_heap_o_reserve_1 (void *vec, int reserve, size_t vec_offset,
if (vec)
free_overhead (pfx);
#endif
-
+
vec = xrealloc (vec, vec_offset + alloc * elt_size);
((struct vec_prefix *)vec)->alloc = alloc;
if (!pfx)
@@ -326,7 +326,7 @@ vec_heap_o_reserve_1 (void *vec, int reserve, size_t vec_offset,
register_overhead ((struct vec_prefix *)vec,
vec_offset + alloc * elt_size PASS_MEM_STAT);
#endif
-
+
return vec;
}