This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 (齐尧)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]