[PD] non-leaky symbols

Johannes M Zmoelnig zmoelnig at iem.at
Wed Nov 24 10:53:24 CET 2004

ix wrote:
> im wondering how others go about avoiding memory leaks caused by excessive symbol generation.
> recently, ive found zexy-l2s to be the 'savior' to a lot of problems, such as:
> .pool loses symbols embedded in lists after load/save
> . at list in toxy does not work with variable length lists
> .other objects work on symbols or float but not variable-length lists.. (or no way to toggle distribution to inlets)
> .qlist wont work with absolute timestamps..but oh wait, l2s & pipe does the trick!
> .want to insert 2, or maybe 3 or 4 elements, into a list after the first 2 elements
> .want to insert an entire list into another message, so use l2s and $1, etc...
> everything works out but the catch is chew 1 mb RAM a minute or more, just from all the symbols being generated. im not sure i really need all them to stick around in some hash table after theyre handed off to another object or split up anyways..

i do not think that [l2s] should be ab-used to do complex 
list-operations (like inserting lists into lists,...)
i mean, [ls2] generates a symbol and a symbol is meant to symbolize 
something rather than store data (well, forget that; but pd's strength 
is certainly not symbol-handling).

so we should improve pd's list handling rather than use symbol-handling 
for this.
until this gets done, i would suggest to make some abstractions that 
emulate this handling; they will certainly be more efficient if you do 
not choose to convert numbers to strings and back again in between; and 
it will be more accurate, as pd's  floats are real floats whereas 
converting them to symbols (strings) rounds them to 8 (or so) decimals.

<payed advertisment>
[l], [packel], [niagara], [glue] (or some version of [prepend]), 
[length], [repack] will allow you to build(!) almost everything you need
</payed advertisment>


> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://iem.at/cgi-bin/mailman/listinfo/pd-list

More information about the Pd-list mailing list