Hi Mike, thanks for the reply What I'm doing is an installation which will run for about an hour. I get some control signals from other laptops and according to some logic set parameters to my audio algorithms / synthesis (so yes, I'm doing sound :-) ). This logic includes a loop and a triple (nested) loop, quite necessary. They are not repeated at sample rate, they will be probably repeated every 30 seconds approximately BUT they will be repeated for a whole hour, that's why I was worried. I will try to test it when I have an hour and see if I run out of memory. But maybe it's a better idea to implement the logic in SuperCollider and send the outcome to ChucK.
From Kas:
Still; in many cases I end up defining the variables outside of the loop (but inside of >>the class or function) and where we'd normally instantiate them I reset them to 0. >>I'm not religious about this as often it's not worth the trouble but for tight, continual >>loops in long term projects I do it and sometimes even go as far as recycling the variables I use for "for" loops
Hi all,
as i've read in the documentation or maybe in some email in this list, ChucK lacks garbage collector. If my understanding is correct this means that it does not automatically free the memory that any variable needs after getting out of its scope. So this probably mean that if I run a loop that declares a variables like
for( int i = 0; i < 100; i++; ) { int var1; float var2[10]; // do things }
and have this code called many times inside an infinite loop and do other stuff in other shreds, after a while it's inevitable to run into
Thanks Kas, yes I use all these techniques, I think I will even try to define the variables outside the class/function and pass it by reference if I see that I have a problem so that memory is allocated only once. I think actually that this might solve the problem. (I hope that it's not only objects/arrays that you pass by reference in ChucK, I'll have to check the manual...)
Dimitris
--- Στις Παρ., 20/03/09, ο/η mike clemow
Is this correct? Is there anything like c++'s delete to free memory?
Dimitris
________________________________ Χρησιμοποιείτε Yahoo! Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-- http://michaelclemow.com http://semiotech.org ___________________________________________________________ Χρησιμοποιείτε Yahoo!; Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr