This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gnat] stmt_group_free_list and gnu_stack_free_list in trans.c
- From: Ian Lance Taylor <iant at google dot com>
- To: okellogg at users dot sourceforge dot net
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 11 Sep 2009 07:50:26 -0700
- Subject: Re: [gnat] stmt_group_free_list and gnu_stack_free_list in trans.c
- References: <1252649625.7094.25.camel@tidbit.site>
oliver.kellogg@t-online.de (Oliver Kellogg) writes:
> What is the point of stmt_group_free_list and gnu_stack_free_list in
> trans.c? Why not always allocate a fresh node?
Just for speed, I assume. It's usually faster to keep a free list than
to go back to the allocator each time. I don't know anything about the
Ada compiler but I assume it needs to allocate a bunch of stmt_group
structures.
stmt_group_free_list is marked deletable which means that if a garbage
collection occurs the memory taken up by the free list will be freed.
Ian