aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/dbg_mlc.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@gcc.gnu.org>1999-04-07 08:01:42 +0000
committerTom Tromey <tromey@gcc.gnu.org>1999-04-07 08:01:42 +0000
commit1530be84fcd15570f9885c29a8cc94880ecd6d57 (patch)
tree7f963ae6b27df44232d80c837e9ccc32932e94af /boehm-gc/dbg_mlc.c
parent537cff9c871369177f5c01fe02d3a9dd85492750 (diff)
downloadgcc-1530be84fcd15570f9885c29a8cc94880ecd6d57.zip
gcc-1530be84fcd15570f9885c29a8cc94880ecd6d57.tar.gz
gcc-1530be84fcd15570f9885c29a8cc94880ecd6d57.tar.bz2
Cygnus/libgcj changes to Boehm GC.
From-SVN: r26257
Diffstat (limited to 'boehm-gc/dbg_mlc.c')
-rw-r--r--boehm-gc/dbg_mlc.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/boehm-gc/dbg_mlc.c b/boehm-gc/dbg_mlc.c
index 6c4b2ba..079e43b 100644
--- a/boehm-gc/dbg_mlc.c
+++ b/boehm-gc/dbg_mlc.c
@@ -80,6 +80,16 @@ ptr_t p;
return(FALSE);
}
+/* Return start of object that might have debugging info. */
+ptr_t GC_debug_object_start(p)
+ptr_t p;
+{
+ register word * result = (word *)((oh *)p + 1);
+ if (! GC_has_debug_info(p))
+ return(p);
+ return((ptr_t)result);
+}
+
/* Store debugging info into p. Return displaced pointer. */
/* Assumes we don't hold allocation lock. */
ptr_t GC_store_debug_info(p, sz, string, integer)
@@ -231,6 +241,35 @@ void GC_start_debugging()
return (GC_store_debug_info(result, (word)lb, s, (word)i));
}
+# ifdef __STDC__
+ GC_PTR GC_debug_generic_malloc(size_t lb, int k, EXTRA_ARGS)
+# else
+ GC_PTR GC_debug_malloc(lb, k, s, i)
+ size_t lb;
+ int k;
+ char * s;
+ int i;
+# ifdef GC_ADD_CALLER
+ --> GC_ADD_CALLER not implemented for K&R C
+# endif
+# endif
+{
+ GC_PTR result = GC_generic_malloc(lb + DEBUG_BYTES, k);
+
+ if (result == 0) {
+ GC_err_printf1("GC_debug_malloc(%ld) returning NIL (",
+ (unsigned long) lb);
+ GC_err_puts(s);
+ GC_err_printf1(":%ld)\n", (unsigned long)i);
+ return(0);
+ }
+ if (!GC_debugging_started) {
+ GC_start_debugging();
+ }
+ ADD_CALL_CHAIN(result, ra);
+ return (GC_store_debug_info(result, (word)lb, s, (word)i));
+}
+
#ifdef STUBBORN_ALLOC
# ifdef __STDC__
GC_PTR GC_debug_malloc_stubborn(size_t lb, EXTRA_ARGS)
@@ -627,3 +666,28 @@ struct closure {
GC_register_finalizer_ignore_self(base, GC_debug_invoke_finalizer,
GC_make_closure(fn,cd), ofn, ocd);
}
+
+# ifdef __STDC__
+ void GC_debug_register_finalizer_no_order
+ (GC_PTR obj, GC_finalization_proc fn,
+ GC_PTR cd, GC_finalization_proc *ofn,
+ GC_PTR *ocd)
+# else
+ void GC_debug_register_finalizer_no_order
+ (obj, fn, cd, ofn, ocd)
+ GC_PTR obj;
+ GC_finalization_proc fn;
+ GC_PTR cd;
+ GC_finalization_proc *ofn;
+ GC_PTR *ocd;
+# endif
+{
+ ptr_t base = GC_base(obj);
+ if (0 == base || (ptr_t)obj - base != sizeof(oh)) {
+ GC_err_printf1(
+ "GC_register_finalizer_no_order called with non-base-pointer 0x%lx\n",
+ obj);
+ }
+ GC_register_finalizer_no_order(base, GC_debug_invoke_finalizer,
+ GC_make_closure(fn,cd), ofn, ocd);
+}