This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[graphds.h] Allocate graph from obstack
- From: Dimitrios Apostolou <jimis at gmx dot net>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Andrey Belevantsev <abel at ispras dot ru>
- Date: Sat, 18 Aug 2012 21:10:16 +0300 (EEST)
- Subject: [graphds.h] Allocate graph from obstack
- References: <alpine.LNX.2.02.1208181352320.20463@localhost.localdomain>
Initially I had one obstack per struct graph, which was better than using
XNEW for every edge, but still obstack_init() called from new_graph() was
too frequent.
So in this iteration of the patch the obstack is static global,
initialised once and never freed. Please advise on whether this is
acceptable, and also where I should initialise the obstack once, and avoid
checking if it's NULL in every use.
Minor speed gains (couple of ms), tested with pre-C++ conversion snapshot,
I'll retest soon and post update.
Thanks,
Dimitris
Attachment:
graph_obstack.diff
Description: Text document