GNU bug report logs - #13783
simplify data_start configuration for Emacs

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Fri, 22 Feb 2013 08:21:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 13783 <at> debbugs.gnu.org
Subject: bug#13783: simplify data_start configuration for Emacs
Date: Fri, 22 Feb 2013 17:36:13 -0800
[Message part 1 (text/plain, inline)]
On 02/22/13 13:34, Eli Zaretskii wrote:
>> From: Paul Eggert <eggert <at> cs.ucla.edu>
>>
>> The patch omits data_start on hosts that use the system malloc,
>> since data_start is now needed only on hosts where GNU Emacs
>> supplies malloc.
> 
> You mean, gmalloc?  How does that come into play?

With the patch, data_start is used only by vm-limit.c.
And vm-limit.c is compiled only when using gmalloc,
as its isn't valid when using a system malloc.

> It seems like data_start and data_size derived from it matter only
> when displaying memory usage warnings -- is that correct?

Yes.

> If so, why doesn't this matter when system malloc is used?

When the system malloc is used Emacs can't warn about low memory,
because it has no way of knowing when memory is low.

> The MS-Windows build computes data_start and data_size inside
> unexw32.c at dump time -- is that good enough?  (I'm asking because
> your change doesn't touch the Windows build.)

Yes, it should be, but that points out a problem with the latest
patch -- it should use DATA_START for MS platforms.  Here's a further
patch to fix that, and I'm attaching the resulting combined patch,
relative to trunk bzr 111860.

=== modified file 'src/vm-limit.c'
--- src/vm-limit.c	2013-02-22 19:26:07 +0000
+++ src/vm-limit.c	2013-02-23 01:28:04 +0000
@@ -22,6 +22,7 @@
 
 #ifdef MSDOS
 #include <dpmi.h>
+extern int etext;
 #endif
 
 /* Some systems need this before <sys/resource.h>.  */
@@ -38,12 +39,16 @@
 
 /* Start of data.  It is OK if this is approximate; it's used only as
    a heuristic.  */
+#ifdef DATA_START
+# define data_start ((char *) DATA_START)
+#else
 extern char data_start[];
-#ifndef HAVE_DATA_START
+# ifndef HAVE_DATA_START
 /* Initialize to nonzero, so that it's put into data and not bss.
    Link this file's object code first, so that this symbol is near the
    start of data.  */
 char data_start[1] = { 1 };
+# endif
 #endif
 
 /*


[data_start.txt (text/plain, attachment)]

This bug report was last modified 12 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.