X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp diff --git a/interpretor/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp b/interpretor/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp new file mode 100644 index 0000000..a0855aa --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp @@ -0,0 +1,28 @@ +#include "loopDetector.hh" +#include "ppbox.hh" + +bool loopDetector::detect(Tree t) +{ + fPhase++; + int w = fPhase%fBuffersize; + fBuffer[w] = t; + if ((fPhase%fCheckperiod) == 0) { + // time to check for a cycle + for (int i=1; i=0); + assert(r