From 133e562adb7f7e7b7510e5e2c82eaa458d3a736e Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 21 Nov 2010 23:04:38 +0000 Subject: [PATCH] fix profon profon (obs from Bernd). --- C/gprof.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/C/gprof.c b/C/gprof.c index 25d9405db..6ae41fd16 100755 --- a/C/gprof.c +++ b/C/gprof.c @@ -1156,20 +1156,6 @@ static Int start_profilers(int msec) } -static Int profon(void) { - Term p; - p=Deref(ARG1); - return(start_profilers(IntOfTerm(p))); -} - -static Int profon0(void) { - return(start_profilers(TIMER_DEFAULT)); -} - -static Int profison(void) { - return (ProfilerOn > 0); -} - static Int profoff(void) { if (ProfilerOn>0) { setitimer(ITIMER_PROF,NULL,NULL); @@ -1179,6 +1165,22 @@ static Int profoff(void) { return FALSE; } +static Int profon(void) { + Term p; + profoff(); + p=Deref(ARG1); + return(start_profilers(IntOfTerm(p))); +} + +static Int profon0(void) { + profoff(); + return(start_profilers(TIMER_DEFAULT)); +} + +static Int profison(void) { + return (ProfilerOn > 0); +} + static Int profalt(void) { if (ProfilerOn==0) return(FALSE); if (ProfilerOn==-1) return profon();