+2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Adjust consing_since_gc when objects are explicitly freed.
+ * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
+ (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
+ (free_cons, free_misc): Subtract object size from consing_since_gc.
+
2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
Simplify and cleanup markers positioning code.
#define GC_STRING_BYTES(S) (STRING_BYTES (S))
+/* Default value of gc_cons_threshold (see below). */
+
+#define GC_DEFAULT_THRESHOLD (100000 * sizeof (Lisp_Object))
+
/* Global variables. */
struct emacs_globals globals;
ptr->car = Vdead;
#endif
cons_free_list = ptr;
+ consing_since_gc -= sizeof *ptr;
total_free_conses++;
}
XMISCTYPE (misc) = Lisp_Misc_Free;
XMISC (misc)->u_free.chain = marker_free_list;
marker_free_list = XMISC (misc);
-
+ consing_since_gc -= sizeof (union Lisp_Misc);
total_free_markers++;
}
gc_in_progress = 0;
consing_since_gc = 0;
- if (gc_cons_threshold < 10000)
- gc_cons_threshold = 10000;
+ if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10)
+ gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10;
gc_relative_threshold = 0;
if (FLOATP (Vgc_cons_percentage))
#endif
refill_memory_reserve ();
- gc_cons_threshold = 100000 * sizeof (Lisp_Object);
+ gc_cons_threshold = GC_DEFAULT_THRESHOLD;
}
void