Branch: Tag:

2002-12-01

2002-12-01 17:36:03 by Martin Stjernholm <mast@lysator.liu.se>

Added a macro to get some debug trace.

Rev: src/cyclic.c:1.9
Rev: src/cyclic.h:1.8

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: cyclic.c,v 1.8 2002/10/11 01:39:30 nilsson Exp $ + || $Id: cyclic.c,v 1.9 2002/12/01 17:36:03 mast Exp $   */      #include "global.h"   #include "cyclic.h"    - RCSID("$Id: cyclic.c,v 1.8 2002/10/11 01:39:30 nilsson Exp $"); + RCSID("$Id: cyclic.c,v 1.9 2002/12/01 17:36:03 mast Exp $");      #define CYCLIC_HASH_SIZE 4711   
33:    if(c == *p)    {    *p=c->next; + #ifdef CYCLIC_DEBUG +  fprintf (stderr, "%s: END_CYCLIC a=%p b=%p: no cycle\n", c->id, c->a, c->b); + #endif    return;    }    }
46:   }      void *begin_cyclic(CYCLIC *c, -  void *id, +  char *id,    void *th,    void *a,    void *b)
69:    {    if(a == p->a && b==p->b && id==p->id)    { + #ifdef CYCLIC_DEBUG +  fprintf (stderr, "%s: BEGIN_CYCLIC a=%p b=%p: found cycle\n", id, a, b); + #endif    ret=p->ret;    break;    }
82:    c->next=cyclic_hash[h];    cyclic_hash[h]=c;    SET_ONERROR(c->onerr, low_unlink_cyclic, c); + #ifdef CYCLIC_DEBUG +  if (!ret) fprintf (stderr, "%s: BEGIN_CYCLIC a=%p b=%p: no cycle\n", id, a, b); + #endif    return ret;   }