aboutsummaryrefslogtreecommitdiffstats
path: root/gc/alloc.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-20 00:37:29 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-20 00:37:29 +0000
commit548b9dd8dbfa0dbe5247d9b4af7e388855beb506 (patch)
tree81b92ab0e12a687937e7948736fcb280dbc8d6c6 /gc/alloc.c
parent[w3m-dev 02655] print version and compile options (diff)
downloadw3m-548b9dd8dbfa0dbe5247d9b4af7e388855beb506.tar.gz
w3m-548b9dd8dbfa0dbe5247d9b4af7e388855beb506.zip
sync with w3m-0.2.2-inu-1.1/gc
Diffstat (limited to 'gc/alloc.c')
-rw-r--r--gc/alloc.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/gc/alloc.c b/gc/alloc.c
index 7786b13..c187a03 100644
--- a/gc/alloc.c
+++ b/gc/alloc.c
@@ -78,7 +78,7 @@ char * GC_copyright[] =
{"Copyright 1988,1989 Hans-J. Boehm and Alan J. Demers ",
"Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. ",
"Copyright (c) 1996-1998 by Silicon Graphics. All rights reserved. ",
-"Copyright (c) 1999-2000 by Hewlett-Packard Company. All rights reserved. ",
+"Copyright (c) 1999-2001 by Hewlett-Packard Company. All rights reserved. ",
"THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY",
" EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK.",
"See source code for details." };
@@ -97,6 +97,8 @@ word GC_free_space_divisor = 3;
extern GC_bool GC_collection_in_progress();
/* Collection is in progress, or was abandoned. */
+extern GC_bool GC_print_back_height;
+
int GC_never_stop_func GC_PROTO((void)) { return(0); }
CLOCK_TYPE GC_start_time; /* Time at which we stopped world. */
@@ -434,7 +436,7 @@ GC_stop_func stop_func;
{
register int i;
int dummy;
-# ifdef PRINTTIMES
+# if defined(PRINTTIMES) || defined(CONDPRINT)
CLOCK_TYPE start_time, current_time;
# endif
@@ -442,6 +444,9 @@ GC_stop_func stop_func;
# ifdef PRINTTIMES
GET_TIME(start_time);
# endif
+# if defined(CONDPRINT) && !defined(PRINTTIMES)
+ if (GC_print_stats) GET_TIME(start_time);
+# endif
# ifdef CONDPRINT
if (GC_print_stats) {
GC_printf1("--> Marking for collection %lu ",
@@ -451,6 +456,11 @@ GC_stop_func stop_func;
(unsigned long) WORDS_TO_BYTES(GC_words_wasted));
}
# endif
+# ifdef MAKE_BACK_GRAPH
+ if (GC_print_back_height) {
+ GC_build_back_graph();
+ }
+# endif
/* Mark from all roots. */
/* Minimize junk left in my registers and on the stack */
@@ -504,6 +514,14 @@ GC_stop_func stop_func;
GET_TIME(current_time);
GC_printf1("World-stopped marking took %lu msecs\n",
MS_TIME_DIFF(current_time,start_time));
+# else
+# ifdef CONDPRINT
+ if (GC_print_stats) {
+ GET_TIME(current_time);
+ GC_printf1("World-stopped marking took %lu msecs\n",
+ MS_TIME_DIFF(current_time,start_time));
+ }
+# endif
# endif
START_WORLD();
return(TRUE);
@@ -610,6 +628,17 @@ void GC_finish_collection()
GET_TIME(finalize_time);
# endif
+ if (GC_print_back_height) {
+# ifdef MAKE_BACK_GRAPH
+ GC_traverse_back_graph();
+# else
+# ifndef SMALL_CONFIG
+ GC_err_printf0("Back height not available: "
+ "Rebuild collector with -DMAKE_BACK_GRAPH\n");
+# endif
+# endif
+ }
+
/* Clear free list mark bits, in case they got accidentally marked */
/* (or GC_find_leak is set and they were intentionally marked). */
/* Also subtract memory remaining from GC_mem_found count. */