From 89b362029282eff2b709e3a64e8e4ec3bc673676 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 3 Jun 2014 10:28:07 +0300 Subject: [PATCH] Define the size of dumped data for MS-Windows locally on w32heap.c. configure.ac (C_HEAP_SWITCH): Remove. src/w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use HEAPSIZE; instead, define separate values for the 32- and 64-bit builds. src/Makefile.in (C_HEAP_SWITCH): Remove. (ALL_CFLAGS): Don't use $(C_HEAP_SWITCH). --- ChangeLog | 4 ++++ configure.ac | 12 ------------ src/ChangeLog | 7 +++++++ src/Makefile.in | 5 +---- src/w32heap.c | 14 +++++++++++++- src/w32heap.h | 4 ---- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index e437bd7b35d..a3d9e0e4721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-06-03 Eli Zaretskii + + * configure.ac (C_HEAP_SWITCH): Remove. + 2014-06-02 Paul Eggert Fix port to 32-bit AIX with xlc (Bug#17598). diff --git a/configure.ac b/configure.ac index 48eda74a061..967d2c44705 100644 --- a/configure.ac +++ b/configure.ac @@ -4835,18 +4835,6 @@ LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS" AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) -## MinGW-specific compilation switch. -C_HEAP_SWITCH= -if test "${opsys}" = "mingw32"; then - ## Preload heap size of temacs.exe in MB. - case "$canonical" in - x86_64-*-*) C_HEAP_SWITCH="-DHEAPSIZE=18" ;; - *) C_HEAP_SWITCH="-DHEAPSIZE=12" ;; - esac -fi - -AC_SUBST(C_HEAP_SWITCH) - ## Common for all window systems if test "$window_system" != "none"; then AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) diff --git a/src/ChangeLog b/src/ChangeLog index 0a31818070f..f0ea2885b8c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2014-06-03 Eli Zaretskii + * w32heap.c (DUMPED_HEAP_SIZE): Move from w32heap.h. Don't use + HEAPSIZE; instead, define separate values for the 32- and 64-bit + builds. + + * Makefile.in (C_HEAP_SWITCH): Remove. + (ALL_CFLAGS): Don't use $(C_HEAP_SWITCH). + Fix MS-Windows build broken by menu changes on 2014-06-02. * w32menu.c (w32_menu_show): Fix a typo that broke compilation. diff --git a/src/Makefile.in b/src/Makefile.in index 697ff3a29f0..bda4623d7de 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -86,9 +86,6 @@ PNG_CFLAGS=@PNG_CFLAGS@ ## something similar. This is normally set by configure. C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ -## Set Emacs dumped heap size for Windows NT -C_HEAP_SWITCH=@C_HEAP_SWITCH@ - ## Define LD_SWITCH_X_SITE to contain any special flags your loader ## may need to deal with X Windows. For instance, if your X libraries ## aren't in a place that your loader can find on its own, you might @@ -322,7 +319,7 @@ MKDEPDIR=@MKDEPDIR@ ## ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG. ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ - -I$(lib) -I$(srcdir)/../lib $(C_HEAP_SWITCH) \ + -I$(lib) -I$(srcdir)/../lib \ $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \ $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \ $(PNG_CFLAGS) $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) \ diff --git a/src/w32heap.c b/src/w32heap.c index bba236cc8d1..f08e1078b0a 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -108,7 +108,19 @@ typedef struct _RTL_HEAP_PARAMETERS { be freed anyway), and we use a new private heap for all new allocations. */ -unsigned char dumped_data[DUMPED_HEAP_SIZE]; +/* FIXME: Most of the space reserved for dumped_data[] is only used by + the 1st bootstrap-emacs.exe built while bootstrapping. Once the + preloaded Lisp files are byte-compiled, the next loadup uses less + than half of the size stated below. It would be nice to find a way + to build only the first bootstrap-emacs.exe with the large size, + and reset that to a lower value afterwards. */ +#ifdef _WIN64 +# define DUMPED_HEAP_SIZE (18*1024*1024) +#else +# define DUMPED_HEAP_SIZE (12*1024*1024) +#endif + +static unsigned char dumped_data[DUMPED_HEAP_SIZE]; /* Info for managing our preload heap, which is essentially a fixed size data area in the executable. */ diff --git a/src/w32heap.h b/src/w32heap.h index 18b6c85c2de..787fe9ade5f 100644 --- a/src/w32heap.h +++ b/src/w32heap.h @@ -28,10 +28,6 @@ along with GNU Emacs. If not, see . * Heap related stuff. */ -#define DUMPED_HEAP_SIZE (HEAPSIZE*1024*1024) - -extern unsigned char dumped_data[]; - extern unsigned char *get_data_start (void); extern unsigned char *get_data_end (void); extern size_t reserved_heap_size; -- 2.39.5