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


Message #20 received at 13783 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 13783 <at> debbugs.gnu.org
Subject: Re: simplify data_start configuration for Emacs
Date: Sat, 23 Feb 2013 12:47:17 +0200
> Date: Fri, 22 Feb 2013 17:36:13 -0800
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: 13783 <at> debbugs.gnu.org
> 
> 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.

I see, thanks.

> > 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.

Thanks.

> --- src/unexcoff.c	2013-01-02 16:13:04 +0000
> +++ src/unexcoff.c	2013-02-22 19:43:17 +0000
> @@ -99,7 +99,7 @@
>  
>  #include <sys/file.h>
>  
> -#include "mem-limits.h"
> +extern int etext[];
>  
>  static long block_copy_start;		/* Old executable start point */
>  static struct filehdr f_hdr;		/* File header */
> @@ -168,7 +168,7 @@
>    pagemask = getpagesize () - 1;
>  
>    /* Adjust text/data boundary. */
> -  data_start = (int) start_of_data ();
> +  data_start = (int) (etext + 1);

I suggest to use DATA_START here (which is defined to '&etext + 1' by
msdos/sed2v2.inp).




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.