User: ben
Date: 05/10/14 03:22:09
Modified: xemacs/src ChangeLog config.h.in alloc.c dumper.c emacs.c
lrecord.h mc-alloc.c mc-alloc.h symbols.c
Log:
add gc percentage threshold to mc-alloc
config.h.in, alloc.c, dumper.c, emacs.c, lrecord.h, mc-alloc.c, mc-alloc.h, symbols.c: Rename MC_ALLOC_TYPE_STATS to ALLOC_TYPE_STATS, since
(with refactoring) this is not really specific to mc-alloc.
Generalize code to implement the GC % threshold for garbage
collecting. Rename `lrecord-stats' to `object-memory-usage-stats'
(defined when not mc-alloc, too). Rename `memory-usage' to
`total-memory-usage' and add `object-memory-usage'. Bump
gc_cons_threshold to 2,000,000 (suggestion by Stephen Turnbull).
Avoid use of C++ reserved word `catch'.
Change address for crash reporting to xemacs-beta(a)xemacs.org from
crashes(a)xemacs.org.
new -> new_ in emacs.c.
Turn on _CRT_SECURE_NO_DEPRECATE under Visual C++ to avoid tons of
warnings in VC8.
Revision Changes Path
1.868 +46 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.867
retrieving revision 1.868
diff -u -p -r1.867 -r1.868
--- ChangeLog 2005/10/10 03:16:22 1.867
+++ ChangeLog 2005/10/14 01:21:57 1.868
@@ -1,3 +1,49 @@
+2005-10-13 Ben Wing <ben(a)xemacs.org>
+
+ * config.h.in:
+ * alloc.c:
+ * alloc.c (struct):
+ * alloc.c (alloc_lrecord):
+ * alloc.c (noseeum_alloc_lrecord):
+ * alloc.c (finalize_string):
+ * alloc.c (make_uninit_string):
+ * alloc.c (make_string_nocopy):
+ * alloc.c (garbage_collect_1):
+ * alloc.c (object_memory_usage_stats):
+ * alloc.c (HACK_O_MATIC):
+ * alloc.c (Fgarbage_collect):
+ * alloc.c (Ftotal_memory_usage):
+ * alloc.c (recompute_need_to_garbage_collect):
+ * alloc.c (common_init_alloc_early):
+ * alloc.c (syms_of_alloc):
+ * alloc.c (vars_of_alloc):
+ * dumper.c (pdump_load_finish):
+ * emacs.c:
+ * emacs.c (main_1):
+ * emacs.c (shut_down_emacs):
+ * lrecord.h:
+ * lrecord.h (MC_ALLOC_CALL_FINALIZER):
+ * mc-alloc.c (remove_cell):
+ * mc-alloc.h:
+ * symbols.c (init_symbols_once_early):
+ Rename MC_ALLOC_TYPE_STATS to ALLOC_TYPE_STATS, since
+ (with refactoring) this is not really specific to mc-alloc.
+ Generalize code to implement the GC % threshold for garbage
+ collecting. Rename `lrecord-stats' to `object-memory-usage-stats'
+ (defined when not mc-alloc, too). Rename `memory-usage' to
+ `total-memory-usage' and add `object-memory-usage'. Bump
+ gc_cons_threshold to 2,000,000 (suggestion by Stephen Turnbull).
+
+ Avoid use of C++ reserved word `catch'.
+
+ Change address for crash reporting to xemacs-beta(a)xemacs.org from
+ crashes(a)xemacs.org.
+
+ new -> new_ in emacs.c.
+
+ Turn on _CRT_SECURE_NO_DEPRECATE under Visual C++ to avoid tons of
+ warnings in VC8.
+
2005-10-10 Andrey Slusar <anrays(a)gmail.com>
* unexelf.c: define `Elfw(type)' for FreeBSD alpha and all _LP64
1.101 +18 -1 XEmacs/xemacs/src/config.h.in
Index: config.h.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/config.h.in,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -p -r1.100 -r1.101
--- config.h.in 2005/04/08 23:11:20 1.100
+++ config.h.in 2005/10/14 01:21:59 1.101
@@ -1,6 +1,6 @@
/* XEmacs site configuration template file. -*- C -*-
Copyright (C) 1986, 1991-1994, 1998, 1999 Free Software Foundation, Inc.
- Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -815,6 +815,13 @@ things are arranged in config.h.in. In
#endif /* WIN32_NO_CONFIGURE */
+#ifdef _MSC_VER
+/* Turn off tons of C4996 warnings in VC 8 about standard functions being
+ "deprecated" in favor of Microsoft-specific "secure" ones (!)
+ This must go *before* the inclusion of any system files. */
+#define _CRT_SECURE_NO_DEPRECATE
+#endif
+
/* alloca twiddling.
Because we might be #including alloca.h here, feature test macros
such as _XOPEN_SOURCE must be defined above.
@@ -907,6 +914,16 @@ extern "C" {
#if defined (USE_SYSTEM_MALLOC) && !defined (SYSTEM_MALLOC)
#define SYSTEM_MALLOC
+#endif
+
+/* This enables type based information (updated during gc). The output
+ is used by show-memory-usage to print memory information for each
+ type. Since the new allocator does not distinguish between types
+ anymore, this functionality is additionally implemented and
+ consumes a lot of time. That is why this functionality can be
+ disabled; for the moment, we keep it enabled. */
+#if !defined (MC_ALLOC) || 1
+# define ALLOC_TYPE_STATS 1
#endif
/* Define the return type of signal handlers if the s/xxx.h file
1.116 +143 -128 XEmacs/xemacs/src/alloc.c
Index: alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/alloc.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -p -r1.115 -r1.116
--- alloc.c 2005/10/04 16:47:10 1.115
+++ alloc.c 2005/10/14 01:21:59 1.116
@@ -1,7 +1,7 @@
/* Storage allocation and gc for XEmacs Lisp interpreter.
Copyright (C) 1985-1998 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004 Ben Wing.
+ Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -94,6 +94,8 @@ static Fixnum debug_allocation_backtrace
/* Number of bytes of consing done since the last gc */
static EMACS_INT consing_since_gc;
EMACS_UINT total_consing;
+EMACS_INT total_gc_usage;
+int total_gc_usage_set;
int need_to_garbage_collect;
int need_to_check_c_alloca;
@@ -510,7 +512,7 @@ allocate_lisp_storage (Bytecount size)
}
#endif /* not MC_ALLOC */
-#ifdef MC_ALLOC_TYPE_STATS
+#if defined (MC_ALLOC) && defined (ALLOC_TYPE_STATS)
static struct
{
int instances_in_use;
@@ -579,7 +581,7 @@ dec_lrecord_stats (Bytecount size_includ
DECREMENT_CONS_COUNTER (size);
}
-#endif /* not MC_ALLOC_TYPE_STATS */
+#endif /* not (MC_ALLOC && ALLOC_TYPE_STATS) */
#ifndef MC_ALLOC
/* lcrecords are chained together through their "next" field.
@@ -605,9 +607,9 @@ alloc_lrecord (Bytecount size,
gc_checking_assert (LRECORD_FREE_P (lheader));
set_lheader_implementation (lheader, implementation);
lheader->uid = lrecord_uid_counter++;
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lheader);
-#endif /* not MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
INCREMENT_CONS_COUNTER (size, implementation->name);
return lheader;
}
@@ -627,9 +629,9 @@ noseeum_alloc_lrecord (Bytecount size,
gc_checking_assert (LRECORD_FREE_P (lheader));
set_lheader_implementation (lheader, implementation);
lheader->uid = lrecord_uid_counter++;
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (size, lheader);
-#endif /* not MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
NOSEEUM_INCREMENT_CONS_COUNTER (size, implementation->name);
return lheader;
}
@@ -2492,9 +2494,9 @@ finalize_string (void *header, int for_d
{
Lisp_String *s = (Lisp_String *) header;
Bytecount size = s->size_;
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
dec_lrecord_string_data_stats (size);
-#endif /* MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
if (BIG_STRING_SIZE_P (size))
xfree (s->data_, Ibyte *);
}
@@ -2614,9 +2616,9 @@ make_uninit_string (Bytecount length)
#ifdef MC_ALLOC
s = alloc_lrecord_type (Lisp_String, &lrecord_string);
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
inc_lrecord_string_data_stats (length);
-#endif /* MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
#else /* not MC_ALLOC */
/* Allocate the string header */
ALLOCATE_FIXED_TYPE (string, Lisp_String, s);
@@ -3000,9 +3002,9 @@ make_string_nocopy (const Ibyte *content
#ifdef MC_ALLOC
s = alloc_lrecord_type (Lisp_String, &lrecord_string);
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
inc_lrecord_string_data_stats (length);
-#endif /* MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
mcpro (wrap_pointer_1 (s)); /* otherwise nocopy_strings get
collected and static data is tried to
be freed. */
@@ -5525,13 +5527,13 @@ garbage_collect_1 (void)
}
{
- struct catchtag *catch;
- for (catch = catchlist; catch; catch = catch->next)
+ struct catchtag *c;
+ for (c = catchlist; c; c = c->next)
{
- mark_object (catch->tag);
- mark_object (catch->val);
- mark_object (catch->actual_tag);
- mark_object (catch->backtrace);
+ mark_object (c->tag);
+ mark_object (c->val);
+ mark_object (c->actual_tag);
+ mark_object (c->backtrace);
}
}
@@ -5667,10 +5669,10 @@ garbage_collect_1 (void)
return;
}
-#ifdef MC_ALLOC
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
+
static Lisp_Object
-gc_plist_hack (const Ascbyte *name, int value, Lisp_Object tail)
+gc_plist_hack (const Ascbyte *name, EMACS_INT value, Lisp_Object tail)
{
/* C doesn't have local functions (or closures, or GC, or readable syntax,
or portable numeric datatypes, or bit-vectors, or characters, or
@@ -5678,13 +5680,14 @@ gc_plist_hack (const Ascbyte *name, int
return cons3 (intern (name), make_int (value), tail);
}
-DEFUN("lrecord-stats", Flrecord_stats, 0, 0 ,"", /*
-Return statistics about lrecords in a property list.
-*/
- ())
+static Lisp_Object
+object_memory_usage_stats (int set_total_gc_usage)
{
Lisp_Object pl = Qnil;
int i;
+ EMACS_INT tgu_val = 0;
+
+#ifdef MC_ALLOC
for (i = 0; i < (countof (lrecord_implementations_table)
+ MODULE_DEFINABLE_TYPE_COUNT); i++)
@@ -5709,6 +5712,7 @@ Return statistics about lrecords in a pr
pl = gc_plist_hack (buf,
lrecord_stats[i].bytes_in_use,
pl);
+ tgu_val += lrecord_stats[i].bytes_in_use_including_overhead;
if (name[len-1] == 's')
sprintf (buf, "%ses-used", name);
@@ -5723,85 +5727,18 @@ Return statistics about lrecords in a pr
lrecord_string_data_bytes_in_use, pl);
pl = gc_plist_hack ("string-data-used",
lrecord_string_data_instances_in_use, pl);
-
- return pl;
-}
-#endif /* not MC_ALLOC_TYPE_STATS */
+ tgu_val += lrecord_string_data_bytes_in_use_including_overhead;
-DEFUN ("garbage-collect", Fgarbage_collect, 0, 0, "", /*
-Reclaim storage for Lisp objects no longer needed.
-Return info on amount of space in use:
- ((USED-CONSES . STORAGE-CONSES) (USED-SYMS . STORAGE-SYMS)
- (USED-MARKERS . STORAGE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS
- PLIST)
- where `PLIST' is a list of alternating keyword/value pairs providing
- more detailed information.
-Garbage collection happens automatically if you cons more than
-`gc-cons-threshold' bytes of Lisp data since previous garbage collection.
-*/
- ())
-{
- garbage_collect_1 ();
-
-#ifdef MC_ALLOC_TYPE_STATS
- /* The things we do for backwards-compatibility */
- return
- list6
- (Fcons (make_int (lrecord_stats[lrecord_type_cons].instances_in_use),
- make_int (lrecord_stats[lrecord_type_cons]
- .bytes_in_use_including_overhead)),
- Fcons (make_int (lrecord_stats[lrecord_type_symbol].instances_in_use),
- make_int (lrecord_stats[lrecord_type_symbol]
- .bytes_in_use_including_overhead)),
- Fcons (make_int (lrecord_stats[lrecord_type_marker].instances_in_use),
- make_int (lrecord_stats[lrecord_type_marker]
- .bytes_in_use_including_overhead)),
- make_int (lrecord_stats[lrecord_type_string]
- .bytes_in_use_including_overhead),
- make_int (lrecord_stats[lrecord_type_vector]
- .bytes_in_use_including_overhead),
- Flrecord_stats ());
-#else /* not MC_ALLOC_TYPE_STATS */
- return Qnil;
-#endif /* not MC_ALLOC_TYPE_STATS */
-}
#else /* not MC_ALLOC */
-/* Debugging aids. */
-static Lisp_Object
-gc_plist_hack (const Ascbyte *name, int value, Lisp_Object tail)
-{
- /* C doesn't have local functions (or closures, or GC, or readable syntax,
- or portable numeric datatypes, or bit-vectors, or characters, or
- arrays, or exceptions, or ...) */
- return cons3 (intern (name), make_int (value), tail);
-}
-
#define HACK_O_MATIC(type, name, pl) do { \
- int s = 0; \
+ EMACS_INT s = 0; \
struct type##_block *x = current_##type##_block; \
while (x) { s += sizeof (*x) + MALLOC_OVERHEAD; x = x->prev; } \
+ tgu_val += s; \
(pl) = gc_plist_hack ((name), s, (pl)); \
} while (0)
-DEFUN ("garbage-collect", Fgarbage_collect, 0, 0, "", /*
-Reclaim storage for Lisp objects no longer needed.
-Return info on amount of space in use:
- ((USED-CONSES . FREE-CONSES) (USED-SYMS . FREE-SYMS)
- (USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS
- PLIST)
- where `PLIST' is a list of alternating keyword/value pairs providing
- more detailed information.
-Garbage collection happens automatically if you cons more than
-`gc-cons-threshold' bytes of Lisp data since previous garbage collection.
-*/
- ())
-{
- Lisp_Object pl = Qnil;
- int i;
- int gc_count_vector_total_size = 0;
- garbage_collect_1 ();
-
for (i = 0; i < lrecord_type_count; i++)
{
if (lcrecord_stats[i].bytes_in_use != 0
@@ -5811,13 +5748,10 @@ Garbage collection happens automatically
char buf [255];
const char *name = lrecord_implementations_table[i]->name;
int len = strlen (name);
- /* save this for the FSFmacs-compatible part of the summary */
- if (i == lrecord_type_vector)
- gc_count_vector_total_size =
- lcrecord_stats[i].bytes_in_use + lcrecord_stats[i].bytes_freed;
sprintf (buf, "%s-storage", name);
pl = gc_plist_hack (buf, lcrecord_stats[i].bytes_in_use, pl);
+ tgu_val += lcrecord_stats[i].bytes_in_use;
/* Okay, simple pluralization check for `symbol-value-varalias' */
if (name[len-1] == 's')
sprintf (buf, "%ses-freed", name);
@@ -5895,7 +5829,70 @@ Garbage collection happens automatically
pl = gc_plist_hack ("conses-free", gc_count_num_cons_freelist, pl);
pl = gc_plist_hack ("conses-used", gc_count_num_cons_in_use, pl);
+#undef HACK_O_MATIC
+
+#endif /* MC_ALLOC */
+
+ if (set_total_gc_usage)
+ {
+ total_gc_usage = tgu_val;
+ total_gc_usage_set = 1;
+ }
+
+ return pl;
+}
+
+DEFUN("object-memory-usage-stats", Fobject_memory_usage_stats, 0, 0 ,"", /*
+Return statistics about memory usage of Lisp objects.
+*/
+ ())
+{
+ return object_memory_usage_stats (0);
+}
+
+#endif /* ALLOC_TYPE_STATS */
+
+/* Debugging aids. */
+
+DEFUN ("garbage-collect", Fgarbage_collect, 0, 0, "", /*
+Reclaim storage for Lisp objects no longer needed.
+Return info on amount of space in use:
+ ((USED-CONSES . FREE-CONSES) (USED-SYMS . FREE-SYMS)
+ (USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS
+ PLIST)
+ where `PLIST' is a list of alternating keyword/value pairs providing
+ more detailed information.
+Garbage collection happens automatically if you cons more than
+`gc-cons-threshold' bytes of Lisp data since previous garbage collection.
+*/
+ ())
+{
+ /* Record total usage for purposes of determining next GC */
+ garbage_collect_1 ();
+
+ /* This will get set to 1, and total_gc_usage computed, as part of the
+ call to object_memory_usage_stats() -- if ALLOC_TYPE_STATS is enabled. */
+ total_gc_usage_set = 0;
+#ifdef ALLOC_TYPE_STATS
/* The things we do for backwards-compatibility */
+#ifdef MC_ALLOC
+ return
+ list6
+ (Fcons (make_int (lrecord_stats[lrecord_type_cons].instances_in_use),
+ make_int (lrecord_stats[lrecord_type_cons]
+ .bytes_in_use_including_overhead)),
+ Fcons (make_int (lrecord_stats[lrecord_type_symbol].instances_in_use),
+ make_int (lrecord_stats[lrecord_type_symbol]
+ .bytes_in_use_including_overhead)),
+ Fcons (make_int (lrecord_stats[lrecord_type_marker].instances_in_use),
+ make_int (lrecord_stats[lrecord_type_marker]
+ .bytes_in_use_including_overhead)),
+ make_int (lrecord_stats[lrecord_type_string]
+ .bytes_in_use_including_overhead),
+ make_int (lrecord_stats[lrecord_type_vector]
+ .bytes_in_use_including_overhead),
+ object_memory_usage_stats (1));
+#else /* not MC_ALLOC */
return
list6 (Fcons (make_int (gc_count_num_cons_in_use),
make_int (gc_count_num_cons_freelist)),
@@ -5904,11 +5901,14 @@ Garbage collection happens automatically
Fcons (make_int (gc_count_num_marker_in_use),
make_int (gc_count_num_marker_freelist)),
make_int (gc_count_string_total_size),
- make_int (gc_count_vector_total_size),
- pl);
-}
-#undef HACK_O_MATIC
+ make_int (lcrecord_stats[lrecord_type_vector].bytes_in_use +
+ lcrecord_stats[lrecord_type_vector].bytes_freed),
+ object_memory_usage_stats (1));
#endif /* not MC_ALLOC */
+#else /* not ALLOC_TYPE_STATS */
+ return Qnil;
+#endif /* ALLOC_TYPE_STATS */
+}
DEFUN ("consing-since-gc", Fconsing_since_gc, 0, 0, "", /*
Return the number of bytes consed since the last garbage collection.
@@ -5934,15 +5934,30 @@ The value is divided by 1024 to make sur
}
#endif
-DEFUN ("memory-usage", Fmemory_usage, 0, 0, 0, /*
+DEFUN ("total-memory-usage", Ftotal_memory_usage, 0, 0, 0, /*
Return the total number of bytes used by the data segment in XEmacs.
This may be helpful in debugging XEmacs's memory usage.
+NOTE: This may or may not be accurate! It is hard to determine this
+value in a system-independent fashion. On Windows, for example, the
+returned number tends to be much greater than reality.
*/
())
{
return make_int (total_data_usage ());
}
+#ifdef ALLOC_TYPE_STATS
+DEFUN ("object-memory-usage", Fobject_memory_usage, 0, 0, 0, /*
+Return total number of bytes used for object storage in XEmacs.
+This may be helpful in debugging XEmacs's memory usage.
+See also `consing-since-gc' and `object-memory-usage-stats'.
+*/
+ ())
+{
+ return make_int (total_gc_usage + consing_since_gc);
+}
+#endif /* ALLOC_TYPE_STATS */
+
void
recompute_funcall_allocation_flag (void)
{
@@ -5961,11 +5976,15 @@ recompute_need_to_garbage_collect (void)
else
need_to_garbage_collect =
(consing_since_gc > gc_cons_threshold
-#if 0 /* #### implement this better */
&&
+#if 0 /* #### implement this better */
(100 * consing_since_gc) / total_data_usage () >=
gc_cons_percentage
-#endif /* 0 */
+#else
+ (!total_gc_usage_set ||
+ (100 * consing_since_gc) / total_gc_usage >=
+ gc_cons_percentage)
+#endif
);
recompute_funcall_allocation_flag ();
}
@@ -6216,13 +6235,12 @@ common_init_alloc_early (void)
funcall_alloca_count = 0;
#if 1
- gc_cons_threshold = 500000; /* XEmacs change */
+ gc_cons_threshold = 2000000; /* XEmacs change */
#else
gc_cons_threshold = 15000; /* debugging */
#endif
- gc_cons_percentage = 0; /* #### 20; Don't have an accurate measure of
- memory usage on Windows; not verified on other
- systems */
+ gc_cons_percentage = 40; /* #### what is optimal? */
+ total_gc_usage_set = 0;
lrecord_uid_counter = 259;
#ifndef MC_ALLOC
debug_string_purity = 0;
@@ -6347,14 +6365,15 @@ syms_of_alloc (void)
DEFSUBR (Fmake_symbol);
DEFSUBR (Fmake_marker);
DEFSUBR (Fpurecopy);
-#ifdef MC_ALLOC_TYPE_STATS
- DEFSUBR (Flrecord_stats);
-#endif /* MC_ALLOC_TYPE_STATS */
+#ifdef ALLOC_TYPE_STATS
+ DEFSUBR (Fobject_memory_usage_stats);
+ DEFSUBR (Fobject_memory_usage);
+#endif /* ALLOC_TYPE_STATS */
DEFSUBR (Fgarbage_collect);
#if 0
DEFSUBR (Fmemory_limit);
#endif
- DEFSUBR (Fmemory_usage);
+ DEFSUBR (Ftotal_memory_usage);
DEFSUBR (Fconsing_since_gc);
}
@@ -6386,26 +6405,22 @@ effective way to check GCPRO problems, b
will be unusable! You almost certainly won't have the patience to wait
long enough to be able to set it back.
-See also `consing-since-gc'.
+See also `consing-since-gc' and `gc-cons-percentage'.
*/ );
DEFVAR_INT ("gc-cons-percentage", &gc_cons_percentage /*
*Percentage of memory allocated between garbage collections.
Garbage collection will happen if this percentage of the total amount of
-memory used for data has been allocated since the last garbage collection.
-However, it will not happen if less than `gc-cons-threshold' bytes have
-been allocated -- this sets an absolute minimum in case very little data
-has been allocated or the percentage is set very low. Set this to 0 to
-have garbage collection always happen after `gc-cons-threshold' bytes have
-been allocated, regardless of current memory usage.
-
-Garbage collection happens automatically when `eval' or `funcall' are
-called. (Note that `funcall' is called implicitly as part of evaluation.)
-By binding this temporarily to a large number, you can effectively
-prevent garbage collection during a part of the program.
+memory used for data (see `lisp-object-memory-usage') has been allocated
+since the last garbage collection. However, it will not happen if less
+than `gc-cons-threshold' bytes have been allocated -- this sets an absolute
+minimum in case very little data has been allocated or the percentage is
+set very low. Set this to 0 to have garbage collection always happen after
+`gc-cons-threshold' bytes have been allocated, regardless of current memory
+usage.
-See also `consing-since-gc'.
+See also `consing-since-gc' and `gc-cons-threshold'.
*/ );
#ifdef DEBUG_XEMACS
1.31 +2 -2 XEmacs/xemacs/src/dumper.c
Index: dumper.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- dumper.c 2005/06/23 11:48:47 1.30
+++ dumper.c 2005/10/14 01:22:00 1.31
@@ -2164,7 +2164,7 @@ pdump_load_finish (void)
if (count == 2)
{
mc_addr = (Rawbyte *) mc_alloc (real_size);
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (real_size,
(const struct lrecord_header *)
((char *) rdata + delta));
@@ -2173,7 +2173,7 @@ pdump_load_finish (void)
== lrecord_type_string)
inc_lrecord_string_data_stats
(((Lisp_String *) ((char *) rdata + delta))->size_);
-#endif /* not MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
}
else
mc_addr = (Rawbyte *) xmalloc_and_zero (real_size);
1.159 +16 -16 XEmacs/xemacs/src/emacs.c
Index: emacs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -p -r1.158 -r1.159
--- emacs.c 2005/10/04 17:51:24 1.158
+++ emacs.c 2005/10/14 01:22:00 1.159
@@ -919,9 +919,9 @@ main_1 (int argc, Wexttext **argv, Wextt
if (!restart)
{
init_mc_allocator ();
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
init_lrecord_stats ();
-#endif /* not MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
}
}
#endif /* MC_ALLOC */
@@ -1217,16 +1217,16 @@ main_1 (int argc, Wexttext **argv, Wextt
This requires inserting a new element into argv. */
if (dpy != 0 && skip_args - count_before == 1)
{
- Wexttext **new = xnew_array (Wexttext *, argc + 2);
+ Wexttext **new_ = xnew_array (Wexttext *, argc + 2);
int j;
for (j = 0; j < count_before + 1; j++)
- new[j] = argv[j];
- new[count_before + 1] = WEXTSTRING ("-d");
- new[count_before + 2] = dpy;
+ new_[j] = argv[j];
+ new_[count_before + 1] = WEXTSTRING ("-d");
+ new_[count_before + 2] = dpy;
for (j = count_before + 2; j <argc; j++)
- new[j + 1] = argv[j];
- argv = new;
+ new_[j + 1] = argv[j];
+ argv = new_;
argc++;
}
/* Change --display to -d, when its arg is separate. */
@@ -2913,7 +2913,7 @@ DEFUN_NORETURN ("run-emacs-from-temacs",
Do not call this. It will reinitialize your XEmacs. You'll be sorry.
*/
/* If this function is called from startup.el, it will be possible to run
- temacs as an editor using 'temacs -batch -l loadup.el run-temacs', instead
+ temacs as an editor using `temacs -batch -l loadup.el run-temacs', instead
of having to dump an emacs and then run that (when debugging emacs itself,
this can be much faster)). [Actually, the speed difference isn't that
much as long as your filesystem is local, and you don't end up with
@@ -3472,17 +3472,17 @@ shut_down_emacs (int sig, Lisp_Object st
"the crash anyway.\n\n"
#ifdef INFODOCK
"Please report this bug by selecting `Report-Bug' in the InfoDock menu, or\n"
-"(last resort) by emailing `crashes(a)xemacs.org' -- note that this is for XEmacs\n"
-"in general, not just Infodock."
+"(last resort) by emailing `xemacs-beta(a)xemacs.org' -- note that this is for\n"
+"XEmacs in general, not just Infodock."
#else
"Please report this bug by invoking M-x report-emacs-bug, or by selecting\n"
"`Send Bug Report' from the Help menu. If that won't work, send ordinary\n"
-"email to `crashes(a)xemacs.org'."
+"email to `xemacs-beta(a)xemacs.org'."
#endif
-" *MAKE SURE* to include this entire output\n"
-"from this crash, especially including the Lisp backtrace, as well as the\n"
-"XEmacs configuration from M-x describe-installation (or equivalently, the\n"
-"file `Installation' in the top of the build tree).\n"
+" *MAKE SURE* to include this entire\n"
+"output from this crash, especially including the Lisp backtrace, as well as\n"
+"the XEmacs configuration from M-x describe-installation (or equivalently,\n"
+"the file `Installation' in the top of the build tree).\n"
#ifdef _MSC_VER
"\n"
"If you are fortunate enough to have some sort of debugging aid installed\n"
1.39 +2 -4 XEmacs/xemacs/src/lrecord.h
Index: lrecord.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lrecord.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -r1.38 -r1.39
--- lrecord.h 2005/05/15 16:38:13 1.38
+++ lrecord.h 2005/10/14 01:22:00 1.39
@@ -376,18 +376,16 @@ extern int gc_in_progress;
#ifdef MC_ALLOC
#include "mc-alloc.h"
-#endif /* MC_ALLOC */
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
void init_lrecord_stats (void);
void inc_lrecord_string_data_stats (Bytecount size);
void dec_lrecord_string_data_stats (Bytecount size);
void inc_lrecord_stats (Bytecount size, const struct lrecord_header *h);
void dec_lrecord_stats (Bytecount size_including_overhead,
const struct lrecord_header *h);
-#endif /* MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
-#ifdef MC_ALLOC
/* Tell mc-alloc how to call a finalizer. */
#define MC_ALLOC_CALL_FINALIZER(ptr) \
{ \
1.5 +2 -2 XEmacs/xemacs/src/mc-alloc.c
Index: mc-alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mc-alloc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- mc-alloc.c 2005/09/14 14:24:30 1.4
+++ mc-alloc.c 2005/10/14 01:22:01 1.5
@@ -1486,10 +1486,10 @@ remove_cell (void *ptr, page_header *ph)
#endif
if (PH_ON_USED_LIST_P (ph))
{
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
dec_lrecord_stats (PH_CELL_SIZE (ph),
(const struct lrecord_header *) ptr);
-#endif /* MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
#ifdef ERROR_CHECK_GC
assert (!LRECORD_FREE_P (ptr));
deadbeef_memory (ptr, PH_CELL_SIZE (ph));
1.2 +0 -12 XEmacs/xemacs/src/mc-alloc.h
Index: mc-alloc.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mc-alloc.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- mc-alloc.h 2005/04/08 23:11:29 1.1
+++ mc-alloc.h 2005/10/14 01:22:01 1.2
@@ -35,18 +35,6 @@ Boston, MA 02111-1307, USA. */
# endif
#endif /* MALLOC_OVERHEAD */
-
-/* This enables type based information (updated during gc). The output
- is used by show-memory-usage to print memory information for each
- type. Since the new allocator does not distinguish between types
- anymore, this functionality is additionally implemented and
- consumes a lot of time. That is why it is kept conditioned on a
- separate flag called MC_ALLOC_TYPE_STATS. */
-#if 1
-# define MC_ALLOC_TYPE_STATS 1
-#endif
-
-
/*--- prototypes -------------------------------------------------------*/
BEGIN_C_DECLS
1.52 +2 -2 XEmacs/xemacs/src/symbols.c
Index: symbols.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/symbols.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -p -r1.51 -r1.52
--- symbols.c 2005/09/29 11:41:22 1.51
+++ symbols.c 2005/10/14 01:22:01 1.52
@@ -3331,10 +3331,10 @@ init_symbols_once_early (void)
mcpro (wrap_pointer_1 (tem));
tem->value = 0;
tem->type = SYMVAL_UNBOUND_MARKER;
-#ifdef MC_ALLOC_TYPE_STATS
+#ifdef ALLOC_TYPE_STATS
inc_lrecord_stats (sizeof (struct symbol_value_magic),
(const struct lrecord_header *) tem);
-#endif /* not MC_ALLOC_TYPE_STATS */
+#endif /* ALLOC_TYPE_STATS */
#else /* not MC_ALLOC */
const struct symbol_value_magic *tem = &guts_of_unbound_marker;
#endif /* not MC_ALLOC */