Is there a technical reason why MidiMessageSequence internally uses an OwnedArray and allocates the MidiEventHolder objects on the heap?
I’m using it internally as a cache mainly because it has the extremely useful createControllerUpdatesForTime method but those allocations make it unsuitable for real-time use.
If it had a clearQuick method and used an Array or std::vector internally (and maybe a reserve would be helpful) I wouldn’t have to rewrite everything to use another type of container…
If I submitted a PR which doesn’t break the API would it likely be accepted?
I was under the impression that it was because MidiEventHolder holds pointers to the note off object, so using stack objects would invalidate that pointer when the container is resized/moved/copied/etc.
But I agree with you, and had to write my own version of similar containers multiple times. Usually I also prefer to store the begin/end objects as one element too, without pointers to each other, which makes operations easier.