Patch: make struct case_node in stmt.c use pool instead of GC
Ian Lance Taylor
iant@google.com
Tue Sep 4 22:45:00 GMT 2007
"Laurynas Biveinis" <laurynas.biveinis@gmail.com> writes:
> 2007-09-04 Laurynas Biveinis <laurynas.biveinis@gmail.com>
>
> * Makefile.in (stmt.o): Add alloc-pool.h dependency.
> * stmt.c: Include alloc-pool.h.
> (struct case_node): Remove GTY marker.
> (add_case_node): New parameter case_node_pool. Use it for
> allocation of r.
> (expand_case): New allocation pool case_node_pool. Initialize it,
> pass to add_case_node and free it.
It's not obvious that this consistently frees the alloc_pool that it
creates. In particular it's possible for expand_case to return
early. I think it would be clearer if you only free the alloc_pool at
the end of the function and at the return statement.
The patch is approved with that change.
Thanks.
:REVIEWMAIL:
Ian
More information about the Gcc-patches
mailing list