moin Martin,
Yep, I just had another glimpse at your [str] code too, and noted the recent change ;-)
I suppose the best workaround for [any2string] is probably going to be pre-allocation too, but it's too late for me to implement that tonight; maybe tomorrow...
marmosets, Bryan
On 2007-07-25 01:00:48, Martin Peach martin.peach@sympatico.ca appears to have written:
Bryan Jurish wrote:
all that allocation and de-allocation at every message just makes my skin crawl... maybe we should find a better way to do it... or just use Martin's string patches ;-)
When I made the [str] external that uses the string atom, I found that constantly reallocating/resizing memory eventually crashed pd so I ended up just allocating a big wad of space up front for each [str]. If the user can set the initial size of this memory then the amount of wasted ram may be minimized, but the default is quite large.
Martin