bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13783: simplify data_start configuration for Emacs


From: Paul Eggert
Subject: bug#13783: simplify data_start configuration for Emacs
Date: Fri, 22 Feb 2013 17:36:13 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

On 02/22/13 13:34, Eli Zaretskii wrote:
>> From: Paul Eggert <eggert@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
 
 /*


Attachment: data_start.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]