I just noticed this comment:
// (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools)
Obviously I try and avoid malloc/new in the audio thread since it can be a rather slow. But every once and a while I use a std::vector or an Array to pass events in/out of the audiothread. What will happen if std::vector or Array does a malloc/new internally? Will it crash Pro-Tools / other hosts?