* gold patch committed: Don't munmap if --keep-files-mapped
@ 2011-03-10 1:18 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2011-03-10 1:18 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 427 bytes --]
This patch to gold avoids calling munmap on a whole file view if
--keep-files-mapped is used. We will have a whole file view if
--map-whole-files is true, as is the default on a 64-bit host. When we
want to map the entire file, calling munmap is just a waste of time.
Committed to mainline.
Ian
2011-03-09 Ian Lance Taylor <iant@google.com>
* fileread.cc (File_read::clear_views): Don't delete the whole
file view.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 711 bytes --]
Index: fileread.cc
===================================================================
RCS file: /cvs/src/src/gold/fileread.cc,v
retrieving revision 1.70
diff -p -u -r1.70 fileread.cc
--- fileread.cc 9 Mar 2011 01:50:33 -0000 1.70
+++ fileread.cc 10 Mar 2011 01:06:49 -0000
@@ -717,7 +717,9 @@ File_read::clear_views(Clear_views_mode
should_delete = false;
else if (mode == CLEAR_VIEWS_ALL)
should_delete = true;
- else if (p->second->should_cache() && keep_files_mapped)
+ else if ((p->second->should_cache()
+ || p->second == this->whole_file_view_)
+ && keep_files_mapped)
should_delete = false;
else if (this->object_count_ > 1
&& p->second->accessed()
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-10 1:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-10 1:18 gold patch committed: Don't munmap if --keep-files-mapped Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).