return 0;
}
+/* Return 1 if P has been marked, zero otherwise. */
+
+int
+ggc_marked_p (p)
+ const void *p;
+{
+ struct ggc_mem *x;
+
+ x = (struct ggc_mem *) ((const char *)p - offsetof (struct ggc_mem, u));
+#ifdef GGC_ALWAYS_VERIFY
+ if (! tree_lookup (x))
+ abort ();
+#endif
+
+ return x->mark;
+}
+
/* Return the size of the gc-able object P. */
size_t
ggc_get_size (p)
const void *p;
{
- struct ggc_mem *x
+ struct ggc_mem *x
= (struct ggc_mem *) ((const char *)p - offsetof (struct ggc_mem, u));
return x->size;
}
/* Called once to initialize the garbage collector. */
-void
+void
init_ggc ()
{
G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED;
/* Finish a GC context. Any uncollected memory in the new context
will be merged with the old context. */
-void
+void
ggc_pop_context ()
{
G.context--;
for (i = 0; i < indent; ++i)
putc (' ', stderr);
fprintf (stderr, "%lx %p\n", (unsigned long)PTR_KEY (p), p);
-
+
if (p->sub[1])
debug_ggc_tree (p->sub[1], indent + 1);
}
/* Clear the statistics. */
memset (&stats, 0, sizeof (stats));
-
+
/* Make sure collection will really occur. */
G.allocated_last_gc = 0;