OSDN Git Service

* config/rs6000/rs6000.c (spe_init_builtins,
[pf3gnuchains/gcc-fork.git] / gcc / ggc-simple.c
index 496508a..d3b5327 100644 (file)
@@ -228,13 +228,30 @@ ggc_set_mark (p)
   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;
 }
@@ -343,7 +360,7 @@ ggc_collect ()
 
 /* Called once to initialize the garbage collector.  */
 
-void 
+void
 init_ggc ()
 {
   G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED;
@@ -366,7 +383,7 @@ ggc_push_context ()
 /* 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--;
@@ -408,7 +425,7 @@ debug_ggc_tree (p, indent)
   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);
 }
@@ -473,7 +490,7 @@ ggc_print_statistics ()
 
   /* Clear the statistics.  */
   memset (&stats, 0, sizeof (stats));
-  
+
   /* Make sure collection will really occur.  */
   G.allocated_last_gc = 0;