]> git.eshelyaron.com Git - emacs.git/commitdiff
(refill_memory_reserve): Move.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Jan 2005 20:22:41 +0000 (20:22 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Jan 2005 20:22:41 +0000 (20:22 +0000)
(emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc)
(reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.

src/ChangeLog
src/alloc.c

index 8499b87d69d75b61d8bfef72089358f5a539de83..990c856fc3810d8d1427a47a2624976f7fab5ad2 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * alloc.c (refill_memory_reserve): Move.
+       (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc)
+       (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.
+
 2005-01-03  Richard M. Stallman  <rms@gnu.org>
 
        * window.c (window_scroll_pixel_based): Don't correct preserve_y
index a1ba6dfc5135869076bc03b99c5b468515272012..3723f9ea872cc86b681c61893f7074eda866f210 100644 (file)
@@ -103,7 +103,7 @@ extern __malloc_size_t __malloc_extra_blocks;
    that the backend handles concurrent access to malloc within its own threads
    but Emacs code running in the main thread is not included in that control).
 
-   When UNBLOCK_INPUT is called, revoke_input_signal may be called.  If this
+   When UNBLOCK_INPUT is called, reinvoke_input_signal may be called.  If this
    happens in one of the backend threads we will have two threads that tries
    to run Emacs code at once, and the code is not prepared for that.
    To prevent that, we only call BLOCK/UNBLOCK from the main thread.  */
@@ -1112,18 +1112,35 @@ allocate_buffer ()
   return b;
 }
 
+\f
+#ifndef SYSTEM_MALLOC
+
+/* If we released our reserve (due to running out of memory),
+   and we have a fair amount free once again,
+   try to set aside another reserve in case we run out once more.
+
+   This is called when a relocatable block is freed in ralloc.c.  */
+
+void
+refill_memory_reserve ()
+{
+  if (spare_memory == 0)
+    spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
+}
+
 \f
 /* Arranging to disable input signals while we're in malloc.
 
    This only works with GNU malloc.  To help out systems which can't
    use GNU malloc, all the calls to malloc, realloc, and free
    elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT
-   pairs; unfortunately, we have no idea what C library functions
+   pair; unfortunately, we have no idea what C library functions
    might call malloc, so we can't really protect them unless you're
    using GNU malloc.  Fortunately, most of the major operating systems
    can use GNU malloc.  */
 
-#ifndef SYSTEM_MALLOC
+#ifndef SYNC_INPUT
+
 #ifndef DOUG_LEA_MALLOC
 extern void * (*__malloc_hook) P_ ((size_t));
 extern void * (*__realloc_hook) P_ ((void *, size_t));
@@ -1182,20 +1199,6 @@ emacs_blocked_free (ptr)
 }
 
 
-/* If we released our reserve (due to running out of memory),
-   and we have a fair amount free once again,
-   try to set aside another reserve in case we run out once more.
-
-   This is called when a relocatable block is freed in ralloc.c.  */
-
-void
-refill_memory_reserve ()
-{
-  if (spare_memory == 0)
-    spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
-}
-
-
 /* This function is the malloc hook that Emacs uses.  */
 
 static void *
@@ -1347,6 +1350,7 @@ uninterrupt_malloc ()
   __realloc_hook = emacs_blocked_realloc;
 }
 
+#endif /* not SYNC_INPUT */
 #endif /* not SYSTEM_MALLOC */