From c339dc2e7e86248a60f484ccdca228ed68826c0b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 16 Apr 2011 13:21:26 -0700 Subject: [PATCH] * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used, so that we aren't warned about unused symbols. --- src/ChangeLog | 3 +++ src/emacs.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9c172f5849d..d555e74c219 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-04-16 Paul Eggert + * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used, + so that we aren't warned about unused symbols. + * xfns.c (Fx_file_dialog): Rename local to avoid shadowing. * xdisp.c (x_produce_glyphs): Avoid possibly-uninitialized diff --git a/src/emacs.c b/src/emacs.c index cccd07417e1..0a132e156a0 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -164,10 +164,6 @@ static void *my_heap_start; /* The gap between BSS end and heap start as far as we can tell. */ static unsigned long heap_bss_diff; -/* If the gap between BSS end and heap start is larger than this - output a warning in dump-emacs. */ -#define MAX_HEAP_BSS_DIFF (1024*1024) - /* Nonzero means running Emacs without interactive terminal. */ int noninteractive; @@ -2100,7 +2096,6 @@ This is used in the file `loadup.el' when building Emacs. You must run Emacs in batch mode in order to dump it. */) (Lisp_Object filename, Lisp_Object symfile) { - extern char my_edata[]; Lisp_Object tem; Lisp_Object symbol; int count = SPECPDL_INDEX (); @@ -2111,6 +2106,10 @@ You must run Emacs in batch mode in order to dump it. */) error ("Dumping Emacs works only in batch mode"); #ifdef GNU_LINUX + + /* Warn if the gap between BSS end and heap start is larger than this. */ +# define MAX_HEAP_BSS_DIFF (1024*1024) + if (heap_bss_diff > MAX_HEAP_BSS_DIFF) { fprintf (stderr, "**************************************************\n"); @@ -2157,7 +2156,10 @@ You must run Emacs in batch mode in order to dump it. */) #ifndef WINDOWSNT /* On Windows, this was done before dumping, and that once suffices. Meanwhile, my_edata is not valid on Windows. */ - memory_warnings (my_edata, malloc_warning); + { + extern char my_edata[]; + memory_warnings (my_edata, malloc_warning); + } #endif /* not WINDOWSNT */ #if defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT /* Pthread may call malloc before main, and then we will get an endless -- 2.39.2