Struct synfx_dsp_jit::DSPNodeContext
source · [−]pub struct DSPNodeContext { /* private fields */ }
Expand description
This table holds all the DSP state including the state of the individual DSP nodes that were created by the [crate::jit::DSPFunctionTranslator].
Implementations
sourceimpl DSPNodeContext
impl DSPNodeContext
sourcepub fn new_ref() -> Rc<RefCell<Self>>
pub fn new_ref() -> Rc<RefCell<Self>>
Creates a new DSPNodeContext that you can pass into crate::JIT::new.
sourcepub fn cleanup_dsp_fun_after_user(&mut self, _fun: Box<DSPFunction>)
pub fn cleanup_dsp_fun_after_user(&mut self, _fun: Box<DSPFunction>)
If you received a DSPFunction back from the audio thread, you should pass it into this function. It will make sure to purge old unused [DSPNodeState] instances.
sourcepub fn free(&mut self)
pub fn free(&mut self)
You must call this after all DSPFunction instances compiled with this state are done executing. If you don’t call this, you might get a memory leak. The API is a bit manual at this point, because usually DSPFunction will be executed on a different thread, and synchronizing this would come with additional overhead that I wanted to save.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DSPNodeContext
impl !Send for DSPNodeContext
impl !Sync for DSPNodeContext
impl Unpin for DSPNodeContext
impl !UnwindSafe for DSPNodeContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more