From 1730d4e206cdb13697e4db911e1cef1f50831342 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 21 Nov 2010 23:04:38 +0000 Subject: [PATCH 1/2] 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(); From 92bfc4cedc173712e41bbf57635883f73ef67749 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 22 Nov 2010 10:36:32 +0000 Subject: [PATCH 2/2] fix loop in c_files (obs from roberto bagnara). --- C/load_foreign.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C/load_foreign.c b/C/load_foreign.c index 434e55f82..13c86b782 100755 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -135,7 +135,7 @@ p_open_shared_object(void) { } ofiles = (StringList) Yap_AllocCodeSpace(sizeof(StringListItem)); - ofiles->next = ofiles; + ofiles->next = NULL; ofiles->s = RepAtom(AtomOfTerm(t))->StrOfAE; if ((ptr = Yap_LoadForeignFile(ofiles->s, IntOfTerm(tflags)))==NULL) { return FALSE; @@ -179,7 +179,7 @@ p_close_shared_object(void) { if (f0) { f0->next = f->next; } else { - ForeignCodeLoaded->next = f->next; + ForeignCodeLoaded = f->next; } handle = f->objs->handle; Yap_FreeCodeSpace((ADDR)f->objs);