]> git.eshelyaron.com Git - emacs.git/commitdiff
2012-12-12 Daniel Colascione <dancol@dancol.org>
authorDaniel Colascione <dancol@dancol.org>
Wed, 12 Dec 2012 03:26:52 +0000 (19:26 -0800)
committerDaniel Colascione <dancol@dancol.org>
Wed, 12 Dec 2012 03:26:52 +0000 (19:26 -0800)
* unexcw.c (fixup_executable): use posix_fallocate to ensure that
the dumped Emacs is not a sparse file, greatly improving Cygwin
"make bootstrap" performance.

src/ChangeLog
src/unexcw.c

index 3311f7c33a35e865d8f1a829bbfece8eb36cbb20..d19b7be739554d386e4a791b952360a462ed2e88 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-12  Daniel Colascione  <dancol@dancol.org>
+
+       * unexcw.c (fixup_executable): use posix_fallocate to ensure that
+       the dumped Emacs is not a sparse file, greatly improving Cygwin
+       "make bootstrap" performance.
+
 2012-12-11  Michael Albinus  <michael.albinus@gmx.de>
 
        * inotify.c (inotify_callback): Generate an Emacs event for every
index 8c5d574530da3ef79eb876f2537b43653f3d2c3a..7d1a72e000985c89a5b4babc93e171d892e22880 100644 (file)
@@ -183,6 +183,19 @@ fixup_executable (int fd)
                exe_header->file_optional_header.FileAlignment *
                exe_header->file_optional_header.FileAlignment;
 
+              /* Make sure the generated bootstrap binary isn't
+               * sparse.  NT doesn't use a file cache for sparse
+               * executables, so if we bootstrap Emacs using a sparse
+               * bootstrap-emacs.exe, bootstrap takes about twenty
+               * times longer than it would otherwise.  */
+
+              ret = posix_fallocate (fd,
+                                     ( exe_header->section_header[i].s_scnptr +
+                                       exe_header->section_header[i].s_size ),
+                                     1);
+
+              assert (ret != -1);
+
              ret =
                lseek (fd,
                       (long) (exe_header->section_header[i].s_scnptr +