/* -*-c-*-
*
- * $Id: utils.c,v 1.4 1997/09/08 13:43:54 mdw Exp $
+ * $Id: utils.c,v 1.6 1998/01/12 16:46:47 mdw Exp $
*
* Miscellaneous useful bits of code.
*
- * (c) 1997 Mark Wooding
+ * (c) 1998 Mark Wooding
*/
/*----- Licensing notice --------------------------------------------------*
/*----- Revision history --------------------------------------------------*
*
* $Log: utils.c,v $
- * Revision 1.4 1997/09/08 13:43:54 mdw
+ * Revision 1.6 1998/01/12 16:46:47 mdw
+ * Fix copyright date.
+ *
+ * Revision 1.5 1997/09/17 10:24:47 mdw
+ * Flush output before and after writing memory tracking information.
+ *
+ * Revision 1.4 1997/09/08 13:43:54 mdw
* Flush tracedump file after each `interesting' write.
*
* Revision 1.3 1997/08/20 16:25:37 mdw
if (q) {
memused += sz;
#ifdef TRACK_VERBOSE
+ fflush(0);
printf("[%p] allocated %lu\n", (void *)(q + 1), (unsigned long)sz);
+ fflush(stdout);
#endif
q->x.sz = sz;
q->x.next = memlist;
return;
q = (szblock *)p - 1;
#ifdef TRACK_VERBOSE
+ fflush(0);
printf("[%p] freed %lu\n", (void *)(q + 1), (unsigned long)q->x.sz);
+ fflush(stdout);
#endif
if (q->x.next)
q->x.next->x.prev = q->x.prev;
qq = (realloc)(q, sz + sizeof(szblock));
if (qq) {
#ifdef TRACK_VERBOSE
+ fflush(0);
printf("[%p->%p] reallocated %lu -> %lu\n",
(void *)(q + 1), (void *)(qq + 1),
(unsigned long)osz, (unsigned long)sz);
+ fflush(stdout);
#endif
qq->x.sz = sz;
qq->x.next = memlist;
void track_memlist(void)
{
szblock *q = memlist;
+ fflush(0);
printf("listing blocks:\n");
while (q) {
printf("... [%p] %lu\n", (void *)(q + 1), (unsigned long)q->x.sz);
q = q->x.next;
}
printf("done\n");
+ fflush(stdout);
}
#endif