Commit 7ea410eb authored by gdr's avatar gdr
Browse files

* ggc.h (GGC_RESIZEVEC): New.

cp/
        * 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.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107887 138bc75d-0d04-0410-961f-82ee72b054a4
parent d4523b3e
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.
......
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.
......
......@@ -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. */
......
......@@ -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;
}
......
......@@ -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) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment