unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Donald Ephraim Curtis <dcurtis@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 8800-done@debbugs.gnu.org, Emacs Development <Emacs-devel@gnu.org>
Subject: Re: Compilation error caused by SPARE_MEMORY
Date: Mon, 6 Jun 2011 07:02:40 -0500	[thread overview]
Message-ID: <E1FBFBBC-7AAF-438A-B779-E20053811484@gmail.com> (raw)
In-Reply-To: <4DEC5EA8.6000904@cs.ucla.edu>

I'm sorry, I've looked at the code currently in alloc.c (revision 104510) and I don't see how this is doing anything other than defining LARGE_REQUEST as (1 << 14)

Here is the relevant code:

/* Amount of spare memory to keep in large reserve block.  */

#define SPARE_MEMORY (1 << 14)

#ifdef SYSTEM_MALLOC
# define LARGE_REQUEST (1 << 14)
#else
# define LARGE_REQUEST SPARE_MEMORY
#endif


But shouldn't there still be a check to see if SPARE_MEMORY is defined already?


On Jun 5, 2011, at 23:59, Paul Eggert wrote:

> On 06/05/11 14:54, Glenn Morris wrote:
> 
>> As reported in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8800
> 
> Thanks, that is a bug I recently introduced; it affects hosts such
> as MacOS that define SYSTEM_MALLOC.  I fixed it in the trunk with
> bzr 104508, as follows:
> 
> === modified file 'src/ChangeLog'
> --- src/ChangeLog	2011-06-05 22:46:26 +0000
> +++ src/ChangeLog	2011-06-06 04:54:23 +0000
> @@ -1,3 +1,11 @@
> +2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
> +
> +	* alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
> +	Do not assume that spare memory exists; that assumption is valid
> +	only if SYSTEM_MALLOC.
> +	(LARGE_REQUEST): New macro, so that the issue of large requests
> +	is separated from the issue of spare memory.
> +
> 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
> 
> 	* editfns.c (Fformat): Correctly handle zero flag with hexadecimal
> 
> === modified file 'src/alloc.c'
> --- src/alloc.c	2011-06-02 08:35:28 +0000
> +++ src/alloc.c	2011-06-06 04:54:23 +0000
> @@ -196,6 +196,12 @@
> #define SPARE_MEMORY (1 << 14)
> #endif
> 
> +#ifdef SYSTEM_MALLOC
> +# define LARGE_REQUEST (1 << 14)
> +#else
> +# define LARGE_REQUEST SPARE_MEMORY
> +#endif
> +
> /* Number of extra blocks malloc should get when it needs more core.  */
> 
> static int malloc_hysteresis;
> @@ -3283,15 +3289,12 @@
> {
>   /* Do not go into hysterics merely because a large request failed.  */
>   int enough_free_memory = 0;
> -  if (SPARE_MEMORY < nbytes)
> +  if (LARGE_REQUEST < nbytes)
>     {
> -      void *p = malloc (SPARE_MEMORY);
> +      void *p = malloc (LARGE_REQUEST);
>       if (p)
> 	{
> -	  if (spare_memory[0])
> -	    free (p);
> -	  else
> -	    spare_memory[0] = p;
> +	  free (p);
> 	  enough_free_memory = 1;
> 	}
>     }
> 
> 




  reply	other threads:[~2011-06-06 12:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 21:10 Compilation error caused by SPARE_MEMORY Ben Key
2011-06-05 21:54 ` Glenn Morris
2011-06-06  4:59   ` Paul Eggert
2011-06-06 12:02     ` Donald Ephraim Curtis [this message]
2011-06-06 16:42       ` bug#8800: " Paul Eggert
2011-06-06  2:50 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1FBFBBC-7AAF-438A-B779-E20053811484@gmail.com \
    --to=dcurtis@gmail.com \
    --cc=8800-done@debbugs.gnu.org \
    --cc=Emacs-devel@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).