I’m working on an FMOD plugin and trying to make sure that all of our memory allocations / frees are routed through FMOD_DSP_ALLOC / FMOD_DSP_FREE. Some of the memory that the plugin is allocating is meant to be shared across multiple plugin instances and the instances may not have the same system object index in their FMOD_DSP_STATE struct. Additionally, since we don’t control the lifetime of the plugin, we don’t know which instance will be responsible for freeing the shared memory.
The behavior of FMOD_DSP_STATE / FMOD_DSP_ALLOC / FMOD_DSP_FREE is a bit unclear to me and I had a few questions about how to handle this scenario:
- Will FMOD_DSP_STATE structs with the same systemobject index always point to the same FMOD_DSP_STATE_FUNCTIONS struct?
- Is #1 true or false if the FMOD_DSP_STATE structs have different systemobject indices?
- Can memory allocated via FMOD_DSP_ALLOC made from one plugin instance be freed with FMOD_DSP_FREE from a different instance with the same systemobject index?
- Is #3 true or false if the plugin instances have different systemobject indices?