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 <dmantipov@yandex.ru>
+
+ 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 <dmantipov@yandex.ru>
Simple wrapper for make_unibyte_string, adjust font_open_by_name.
/* 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. */
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
gc_in_progress = 1;
- /* clear_marks (); */
-
/* Mark all the special slots that serve as the roots of accessibility. */
for (i = 0; i < staticidx; i++)
CHECK_CONS_LIST ();
- /* clear_marks (); */
gc_in_progress = 0;
consing_since_gc = 0;
#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);
#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 */