diff options
author | Dai Sato <satodai@dog.intcul.tohoku.ac.jp> | 2001-11-22 17:52:28 +0000 |
---|---|---|
committer | Dai Sato <satodai@dog.intcul.tohoku.ac.jp> | 2001-11-22 17:52:28 +0000 |
commit | a5067a1853b490e9c551ac2ff7c4cb58a9bb3f48 (patch) | |
tree | 42ca751a0b79dd050082b1e87c7d8957c161c6ff /gc/gcj_mlc.c | |
parent | [w3m-dev 02509] (diff) | |
download | w3m-a5067a1853b490e9c551ac2ff7c4cb58a9bb3f48.tar.gz w3m-a5067a1853b490e9c551ac2ff7c4cb58a9bb3f48.zip |
w3m-0.2.2-inu-1.1 sourceinu-0-2-2-rel-1-1inu-0-2-2
Diffstat (limited to 'gc/gcj_mlc.c')
-rw-r--r-- | gc/gcj_mlc.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/gc/gcj_mlc.c b/gc/gcj_mlc.c index 7e79521..89f0d72 100644 --- a/gc/gcj_mlc.c +++ b/gc/gcj_mlc.c @@ -54,6 +54,7 @@ ptr_t * GC_gcjdebugobjfreelist; void GC_init_gcj_malloc(int mp_index, void * /* really GC_mark_proc */mp) { register int i; + GC_bool ignore_gcj_info; DCL_LOCK_STATE; GC_init(); /* In case it's not already done. */ @@ -65,6 +66,12 @@ void GC_init_gcj_malloc(int mp_index, void * /* really GC_mark_proc */mp) return; } GC_gcj_malloc_initialized = TRUE; + ignore_gcj_info = (0 != GETENV("GC_IGNORE_GCJ_INFO")); +# ifdef CONDPRINT + if (GC_print_stats && ignore_gcj_info) { + GC_printf0("Gcj-style type information is disabled!\n"); + } +# endif GC_mark_procs[mp_index] = (GC_mark_proc)mp; if (mp_index >= GC_n_mark_procs) ABORT("GC_init_gcj_malloc: bad index"); /* Set up object kind gcj-style indirect descriptor. */ @@ -75,9 +82,17 @@ void GC_init_gcj_malloc(int mp_index, void * /* really GC_mark_proc */mp) GC_gcj_kind = GC_n_kinds++; GC_obj_kinds[GC_gcj_kind].ok_freelist = GC_gcjobjfreelist; GC_obj_kinds[GC_gcj_kind].ok_reclaim_list = 0; - GC_obj_kinds[GC_gcj_kind].ok_descriptor = - (((word)(-MARK_DESCR_OFFSET - GC_INDIR_PER_OBJ_BIAS)) | GC_DS_PER_OBJECT); - GC_obj_kinds[GC_gcj_kind].ok_relocate_descr = FALSE; + if (ignore_gcj_info) { + /* Use a simple length-based descriptor, thus forcing a fully */ + /* conservative scan. */ + GC_obj_kinds[GC_gcj_kind].ok_descriptor = (0 | GC_DS_LENGTH); + GC_obj_kinds[GC_gcj_kind].ok_relocate_descr = TRUE; + } else { + GC_obj_kinds[GC_gcj_kind].ok_descriptor = + (((word)(-MARK_DESCR_OFFSET - GC_INDIR_PER_OBJ_BIAS)) + | GC_DS_PER_OBJECT); + GC_obj_kinds[GC_gcj_kind].ok_relocate_descr = FALSE; + } GC_obj_kinds[GC_gcj_kind].ok_init = TRUE; /* Set up object kind for objects that require mark proc call. */ GC_gcjdebugobjfreelist = (ptr_t *) @@ -88,9 +103,14 @@ void GC_init_gcj_malloc(int mp_index, void * /* really GC_mark_proc */mp) GC_gcj_debug_kind = GC_n_kinds++; GC_obj_kinds[GC_gcj_debug_kind].ok_freelist = GC_gcjdebugobjfreelist; GC_obj_kinds[GC_gcj_debug_kind].ok_reclaim_list = 0; - GC_obj_kinds[GC_gcj_debug_kind].ok_descriptor = - GC_MAKE_PROC(mp_index, 1 /* allocated with debug info */); - GC_obj_kinds[GC_gcj_debug_kind].ok_relocate_descr = FALSE; + if (ignore_gcj_info) { + GC_obj_kinds[GC_gcj_kind].ok_descriptor = (0 | GC_DS_LENGTH); + GC_obj_kinds[GC_gcj_kind].ok_relocate_descr = TRUE; + } else { + GC_obj_kinds[GC_gcj_debug_kind].ok_descriptor = + GC_MAKE_PROC(mp_index, 1 /* allocated with debug info */); + GC_obj_kinds[GC_gcj_debug_kind].ok_relocate_descr = FALSE; + } GC_obj_kinds[GC_gcj_debug_kind].ok_init = TRUE; UNLOCK(); ENABLE_SIGNALS(); |