Commit c4be79d2 by Richard Kenner

(print_obstack_name): New function; derived from original debug_obstack.

(debug_obstack): Call print_obstack_name.

From-SVN: r5095
parent f3b4fb6e
...@@ -594,8 +594,10 @@ savealloc (size) ...@@ -594,8 +594,10 @@ savealloc (size)
/* Print out which obstack an object is in. */ /* Print out which obstack an object is in. */
void void
debug_obstack (object) print_obstack_name (object, file, prefix)
char *object; char *object;
FILE *file;
char *prefix;
{ {
struct obstack *obstack = NULL; struct obstack *obstack = NULL;
char *obstack_name = NULL; char *obstack_name = NULL;
...@@ -651,13 +653,21 @@ debug_obstack (object) ...@@ -651,13 +653,21 @@ debug_obstack (object)
{ {
if (object >= obstack->next_free if (object >= obstack->next_free
&& object < obstack->chunk_limit) && object < obstack->chunk_limit)
fprintf (stderr, "object in free portion of obstack %s.\n", fprintf (file, "%s in free portion of obstack %s",
obstack_name); prefix, obstack_name);
else else
fprintf (stderr, "object allocated from %s.\n", obstack_name); fprintf (file, "%s allocated from %s", prefix, obstack_name);
} }
else else
fprintf (stderr, "object not allocated from any obstack.\n"); fprintf (file, "%s not allocated from any obstack", prefix);
}
void
debug_obstack (object)
char *object;
{
print_obstack_name (object, stderr, "object");
fprintf (stderr, ".\n");
} }
/* Return 1 if OBJ is in the permanent obstack. /* Return 1 if OBJ is in the permanent obstack.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment