]> code.delx.au - gnu-emacs/blobdiff - src/unexcw.c
* src/callint.c (Fcall_interactively): Use the right lexical environment
[gnu-emacs] / src / unexcw.c
index eae534cf4ddd957a669c3a9fd8f7c95df2d859e7..af93e158e144d918ad09d7e08a9b529ec42ed831 100644 (file)
@@ -1,7 +1,7 @@
 /* unexec() support for Cygwin;
    complete rewrite of xemacs Cygwin unexec() code
 
-   Copyright (C) 2004-2012 Free Software Foundation, Inc.
+   Copyright (C) 2004-2013 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -20,8 +20,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include "unexec.h"
+#include "w32common.h"
 
-#include <setjmp.h>
 #include <lisp.h>
 #include <stdio.h>
 #include <fcntl.h>
@@ -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 +