emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104508: * alloc.c (memory_full) [SYS


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104508: * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacO).
Date: Sun, 05 Jun 2011 21:54:23 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104508
fixes bug(s): http://debbugs.gnu.org/8800
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sun 2011-06-05 21:54:23 -0700
message:
  * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacO).
modified:
  src/ChangeLog
  src/alloc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-06-05 22:46:26 +0000
+++ b/src/ChangeLog     2011-06-06 04:54:23 +0000
@@ -1,3 +1,11 @@
+2011-06-06  Paul Eggert  <address@hidden>
+
+       * 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  <address@hidden>
 
        * editfns.c (Fformat): Correctly handle zero flag with hexadecimal

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2011-06-02 08:35:28 +0000
+++ b/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 via email to

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