emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109168: Make maybe_gc inline.


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109168: Make maybe_gc inline.
Date: Fri, 20 Jul 2012 17:14:58 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109168
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Fri 2012-07-20 17:14:58 +0400
message:
  Make maybe_gc inline.
  Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
  * lisp.h (consing_since_gc, gc_relative_threshold)
  (memory_full_cons_threshold): Revert declaration.
  (maybe_gc): Remove prototype, define as inline.
  * alloc.c: Remove old commented-out code.
  (consing_since_gc, gc_relative_threshold)
  (memory_full_cons_threshold): Revert to global.
  (maybe_gc): Remove.
modified:
  src/ChangeLog
  src/alloc.c
  src/lisp.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-20 07:29:04 +0000
+++ b/src/ChangeLog     2012-07-20 13:14:58 +0000
@@ -1,5 +1,17 @@
 2012-07-20  Dmitry Antipov  <address@hidden>
 
+       Make maybe_gc inline.
+       Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
+       * lisp.h (consing_since_gc, gc_relative_threshold)
+       (memory_full_cons_threshold): Revert declaration.
+       (maybe_gc): Remove prototype, define as inline.
+       * alloc.c: Remove old commented-out code.
+       (consing_since_gc, gc_relative_threshold)
+       (memory_full_cons_threshold): Revert to global.
+       (maybe_gc): Remove.
+
+2012-07-20  Dmitry Antipov  <address@hidden>
+
        Simple wrapper for make_unibyte_string, adjust font_open_by_name.
        * lisp.h (build_unibyte_string): New function.
        * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-07-20 05:28:00 +0000
+++ b/src/alloc.c       2012-07-20 13:14:58 +0000
@@ -166,16 +166,16 @@
 
 /* Number of bytes of consing done since the last gc.  */
 
-static EMACS_INT consing_since_gc;
+EMACS_INT consing_since_gc;
 
 /* Similar minimum, computed from Vgc_cons_percentage.  */
 
-static EMACS_INT gc_relative_threshold;
+EMACS_INT gc_relative_threshold;
 
 /* Minimum number of bytes of consing since GC before next GC,
    when memory is full.  */
 
-static EMACS_INT memory_full_cons_threshold;
+EMACS_INT memory_full_cons_threshold;
 
 /* Nonzero during GC.  */
 
@@ -5374,18 +5374,6 @@
   return make_number (min (MOST_POSITIVE_FIXNUM, number));
 }
 
-/* Check whether it's time for GC, and run it if so.  */
-
-void
-maybe_gc (void)
-{
-  if ((consing_since_gc > gc_cons_threshold
-       && consing_since_gc > gc_relative_threshold)
-      || (!NILP (Vmemory_full)
-         && consing_since_gc > memory_full_cons_threshold))
-    Fgarbage_collect ();
-}
-
 DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "",
        doc: /* Reclaim storage for Lisp objects no longer needed.
 Garbage collection happens automatically if you cons more than
@@ -5474,8 +5462,6 @@
 
   gc_in_progress = 1;
 
-  /* clear_marks (); */
-
   /* Mark all the special slots that serve as the roots of accessibility.  */
 
   for (i = 0; i < staticidx; i++)
@@ -5592,7 +5578,6 @@
 
   CHECK_CONS_LIST ();
 
-  /* clear_marks (); */
   gc_in_progress = 0;
 
   consing_since_gc = 0;

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-07-20 07:29:04 +0000
+++ b/src/lisp.h        2012-07-20 13:14:58 +0000
@@ -2593,10 +2593,12 @@
 #if defined REL_ALLOC && !defined SYSTEM_MALLOC
 extern void refill_memory_reserve (void);
 #endif
-extern void maybe_gc (void);
 extern const char *pending_malloc_warning;
 extern Lisp_Object zero_vector;
 extern Lisp_Object *stack_base;
+extern EMACS_INT consing_since_gc;
+extern EMACS_INT gc_relative_threshold;
+extern EMACS_INT memory_full_cons_threshold;
 extern Lisp_Object list1 (Lisp_Object);
 extern Lisp_Object list2 (Lisp_Object, Lisp_Object);
 extern Lisp_Object list3 (Lisp_Object, Lisp_Object, Lisp_Object);
@@ -3434,4 +3436,16 @@
 
 #include "globals.h"
 
+/* Check whether it's time for GC, and run it if so.  */
+
+static inline void
+maybe_gc (void)
+{
+  if ((consing_since_gc > gc_cons_threshold
+       && consing_since_gc > gc_relative_threshold)
+      || (!NILP (Vmemory_full)
+         && consing_since_gc > memory_full_cons_threshold))
+    Fgarbage_collect ();
+}
+
 #endif /* EMACS_LISP_H */


reply via email to

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