This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

graphds.[ch]: alloc_pool for edges


free() was called way too often before, this patch reduces it significantly. Minor speed-up here too, I don't mention it individually since numbers are within noise margins.


2011-08-22 Dimitrios Apostolou <jimis@gmx.net>


	* graphds.h (struct graph): Added edge_pool as a pool for
	allocating edges.
	* graphds.c (new_graph): Initialise edge_pool.
	(add_edge): Allocate edge from edge_pool rather than with malloc.
	(free_graph): Instead of iterating across the graph freeing edges,
	just destroy the edge_pool.

Attachment: graphds.diff
Description: Text document


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