aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/class.c5
-rw-r--r--gcc/cp/parser.c4
-rw-r--r--gcc/ggc.h1
5 files changed, 17 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5c629b2..305d1ee 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * ggc.h (GGC_RESIZEVEC): New.
+
2005-12-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* gcc.c (execute): Improve readability.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b0ba117..417f277 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,13 @@
2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * parser.c (cp_lexer_new_main): Usr GGC_RESIZEVEC instead of
+ ggc_realloc.
+ (cp_parser_template_argument_list): Use XRESIZEVEC instead of
+ xrealloc.
+ * class.c (pushclass): Likewise.
+
+2005-12-02 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* decl2.c (get_priority_info): Use XNEW, not xmalloc.
* decl.c (push_switch): Likewise.
* lex.c (handle_pragma_implementation): Likewise.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 5c1b9e1..9d53e80 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -5382,9 +5382,8 @@ pushclass (tree type)
{
current_class_stack_size *= 2;
current_class_stack
- = xrealloc (current_class_stack,
- current_class_stack_size
- * sizeof (struct class_stack_node));
+ = XRESIZEVEC (struct class_stack_node, current_class_stack,
+ current_class_stack_size);
}
/* Insert a new entry on the class stack. */
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 4316422..8eb4fbf 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -286,7 +286,7 @@ cp_lexer_new_main (void)
{
space = alloc;
alloc *= 2;
- buffer = ggc_realloc (buffer, alloc * sizeof (cp_token));
+ buffer = GGC_RESIZEVEC (cp_token, buffer, alloc);
pos = buffer + space;
}
cp_lexer_get_preprocessor_token (lexer, pos);
@@ -8934,7 +8934,7 @@ cp_parser_template_argument_list (cp_parser* parser)
memcpy (arg_ary, fixed_args, sizeof (tree) * n_args);
}
else
- arg_ary = xrealloc (arg_ary, sizeof (tree) * alloced);
+ arg_ary = XRESIZEVEC (tree, arg_ary, alloced);
}
arg_ary[n_args++] = argument;
}
diff --git a/gcc/ggc.h b/gcc/ggc.h
index d6b2ea8..d6e2303 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -231,6 +231,7 @@ extern void dump_ggc_loc_statistics (void);
#define GGC_CNEWVEC(T, N) ((T *) ggc_alloc_cleared ((N) * sizeof(T)))
#define GGC_NEWVAR(T, S) ((T *) ggc_alloc ((S)))
#define GGC_CNEWVAR(T, S) ((T *) ggc_alloc_cleared ((S)))
+#define GGC_RESIZEVEC(T, P, N) ((T *) ggc_realloc ((P), (N) * sizeof (T)))
#define ggc_alloc_rtvec(NELT) \
((rtvec) ggc_alloc_zone (sizeof (struct rtvec_def) + ((NELT) - 1) \