X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/1059e1cc0c2ecfa237406949aa26155b6a5b9154..66f23d4fabf89ad09adbd4dfc15ac6b5b2b7da83:/interpreter/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp diff --git a/interpreter/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp b/interpreter/preprocessor/faust-0.9.47mr3/compiler/evaluate/loopDetector.cpp new file mode 100644 index 0000000..a0855aa --- /dev/null +++ b/interpreter/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