fixes for SYSTEM_MALLOC case (where we cannot trust Yap_HeapTop and Yap_HeapBase).

This commit is contained in:
Vitor Santos Costa 2009-11-20 08:52:00 +00:00
parent 1bfbe535da
commit 58cac4c8eb

View File

@ -1011,12 +1011,14 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
} }
} }
#if !USE_SYSTEM_MALLOC
if (P < (yamop *)Yap_HeapBase || P > (yamop *)HeapTop) { if (P < (yamop *)Yap_HeapBase || P > (yamop *)HeapTop) {
#if DEBUG #if DEBUG
fprintf(stderr,"Oops: %p, %p\n", oldpc, current_p); fprintf(stderr,"Oops: %p, %p\n", oldpc, current_p);
#endif #endif
return; return;
} }
#endif
if (Yap_OffLineProfiler) { if (Yap_OffLineProfiler) {
fprintf(FProf,"%p %p ", oldpc, current_p); fprintf(FProf,"%p %p ", oldpc, current_p);
@ -1048,6 +1050,7 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
ProfOn=FALSE; ProfOn=FALSE;
return; return;
} }
#if !USE_SYSTEM_MALLOC
/* add this clause as new node to the tree */ /* add this clause as new node to the tree */
if (start < (CODEADDR)Yap_HeapBase || start > (CODEADDR)HeapTop || if (start < (CODEADDR)Yap_HeapBase || start > (CODEADDR)HeapTop ||
end < (CODEADDR)Yap_HeapBase || end > (CODEADDR)HeapTop) { end < (CODEADDR)Yap_HeapBase || end > (CODEADDR)HeapTop) {
@ -1056,6 +1059,7 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
#endif #endif
return; return;
} }
#endif
if (pp->ArityOfPE > 100) { if (pp->ArityOfPE > 100) {
#if DEBUG #if DEBUG
fprintf(stderr,"%p:%p(%lu)-->%p\n",oldpc,current_p,(unsigned long int)Yap_op_from_opcode(current_p->opc),pp); fprintf(stderr,"%p:%p(%lu)-->%p\n",oldpc,current_p,(unsigned long int)Yap_op_from_opcode(current_p->opc),pp);