|
|
1.1 ! root 1: #ifndef lint ! 2: static char *rcsid = ! 3: "$Header: lamp.c,v 1.3 83/12/09 16:51:36 sklower Exp $"; ! 4: #endif ! 5: ! 6: /* -[Tue Mar 22 15:17:09 1983 by jkf]- ! 7: * lamp.c $Locker: $ ! 8: * interface with unix profiling ! 9: * ! 10: * (c) copyright 1982, Regents of the University of California ! 11: */ ! 12: ! 13: #include "global.h" ! 14: ! 15: #ifdef PROF ! 16: ! 17: #define PBUFSZ 500000 ! 18: short pbuf[PBUFSZ]; ! 19: ! 20: /* data space for fasl to put counters */ ! 21: int mcnts[NMCOUNT]; ! 22: int mcntp = (int) mcnts; ! 23: int doprof = TRUE; ! 24: ! 25: lispval ! 26: Lmonitor() ! 27: { ! 28: extern etext, countbase; ! 29: ! 30: if (np==lbot) { monitor((int(*)())0); countbase = 0; } ! 31: else if (TYPE(lbot->val)==INT) ! 32: { monitor((int (*)())2, (int (*)())lbot->val->i, pbuf, ! 33: PBUFSZ*(sizeof(short)), 7000); ! 34: countbase = ((int)pbuf) +12; ! 35: } ! 36: else { ! 37: monitor((int (*)())2, (int (*)())sbrk(0), pbuf, ! 38: PBUFSZ*(sizeof(short)), 7000); ! 39: countbase = ((int)pbuf) + 12; } ! 40: return(tatom); ! 41: } ! 42: ! 43: ! 44: #else ! 45: ! 46: /* if prof is not defined, create a dummy Lmonitor */ ! 47: ! 48: short pbuf[8]; ! 49: ! 50: /* data space for fasl to put counters */ ! 51: int mcnts[1]; ! 52: int mcntp = (int) mcnts; ! 53: int doprof = FALSE; ! 54: ! 55: Lmonitor() ! 56: { ! 57: error("Profiling not enabled",FALSE); ! 58: } ! 59: ! 60: ! 61: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.