[PATCH] gold: add an option to mmap whole files (defaults to true on 64-bit linkers)

Mikolaj Zalewski mikolajz@google.com
Thu Oct 22 00:57:00 GMT 2009


  I have created a patch adding an option to mmap whole file in
File_read::open and making it default on 64-bit linker builds. This
seems to speed up large builds. The changes were very similar to the
already existing support to open pseudo-files (for tests) with
contents passed as an argument, so I've merged both features.

Mikołaj

2009-10-21  Mikolaj Zalewski  <mikolajz@google.com>

	* fileread.cc: (File_read::View::~View): Use the new data_ownership_ filed.
	(File_read::~File_read): Dispose the new whole_file_view_.
	(File_read::open): Mmap the whole file if needed.
	(File_read::open): Use whole_file_view_ instead of contents_.
	(File_read::find_view): Use whole_file_view_ if applicable.
	(File_read::do_read): Use whole_file_view_ instead of contents_.
	(File_read::make_view): Use whole_file_view_ instead of contents_,
update File_read::View::View call.
	(File_read::find_or_make_view): Update File_read::View::View call.
	* fileread.h: (File_read::File_read): Initialize whole_file_view_,
remove contents_.
	(File_read::View::Data_ownership): New enum.
	(File_read::View::View): Replace bool mapped with Data_ownership argument.
	(File_read::View::mapped_): Remove (replaced by data_ownership_).
	(File_read::View::data_ownership_): New field.
	(File_read::contents_): Remove (replaced by whole_file_view_).
	(File_read::whole_file_view_): New field.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gold-add-an-option-to-mmap-whole-files-defaults-to.patch
Type: text/x-patch
Size: 8922 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20091022/a1b28471/attachment.bin>


More information about the Binutils mailing list