Nope. You can write a wrapper that sanity checks that the buffer layout is "good enough" and transparently performs a copy to temporary if there's something cheesy going on.Dos it mean, that I always should write such "fetch -> process -> store" boilerplate in my DSP code to be robust against shuffled/permuted in place buffers?
Btw.. one can also do "in-place" processing with separate input/output buffers: the first thing you do in process() is copy the input to the output buffer.. and then you can modify the output buffer as if it was serving as both buffers at once.
Then if you want to be really clever you can write a general shuffling algorithm that tries to minimize the number of copies when the inputs and outputs overlap arbitrarily. Without in-place swap tricks, this takes one temporary buffer worst-case to break cycles... but .. I think it might be a bit overkill.
Statistics: Posted by mystran — Thu Apr 18, 2024 4:35 pm