[Patch, fortran] Reduce size of pointer_info tree

Janne Blomqvist blomqvist.janne@gmail.com
Sun Jan 29 20:33:00 GMT 2012


Hi,

the attached patch reduces the size of the pointer_info tree used when
reading and writing module files by making the module and symbol names
pointers rather than arrays. As the strings are already put into heap
memory and resized to their correct size during parsing, we have
already paid the price of using the heap and we can just point to
those parsed strings instead of copying them.

Also, a few minor cleanups from my previous patch to heap allocate
binding_label.

Committed as obvious.

2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>

	* module.c (pointer_info): Make true_name and module pointers
	rather than arrays, order pointers before other fields.
	(free_pi_tree): free true_name and module as well.
	(mio_read_string): Rename to read_string.
	(mio_write_string): Remove.
	(load_commons): Use read_string.
	(read_module): Use read_string rather than mio_internal_string.
	(write_blank_common): Call write_atom directly.
	(write_symbol): Likewise.



-- 
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pointer_info_size.diff
Type: text/x-patch
Size: 3092 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120129/79b53e5d/attachment.bin>


More information about the Gcc-patches mailing list