Re: [PATCH 02/40] Eliminate make_cleanup_obstack_free, introduce auto_obstack

Yao Qi
2017-06-28T10:36:43Z

Pedro Alves <palves@redhat.com> writes:

> +/* An obstack that frees itself on scope exit. */
> +struct auto_obstack : obstack
> +{
> + auto_obstack ()
> + { obstack_init (this); }
> +
> + ~auto_obstack ()
> + { obstack_free (this, NULL); }
> +
> + /* Free all memory in the obstack but leave it valid for further
> + allocation. */
> + void clear ()
> + { obstack_free (this, obstack_base (this)); }
> +};

Hi Pedro,
Did you consider "upstream" this to include/obstack.h? so that gcc can
use it as well.

--
Yao (齐尧)