Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/src/events/io/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ impl EventBuffer {
///
/// It is necessary to sort the events before passing them to a plugin.
pub fn sort(&mut self) {
self.indexes.sort_by_key(|i| {
// this needs to be an unstable sort, as the std stable sort might allocate
self.indexes.sort_unstable_by_key(|i| {
// SAFETY: Registered indexes always have actual event headers written by append_header_data
// PANIC: We used registered indexes, this should never panic
let event = unsafe { self.headers[*i as usize].assume_init_ref() };
Expand Down
4 changes: 2 additions & 2 deletions extensions/src/gui/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ impl PluginGui {
plugin
.use_extension(&self.0)
.hide
.ok_or(GuiError::ShowError)?(plugin.as_raw())
.ok_or(GuiError::HideError)?(plugin.as_raw())
}
.then_some(())
.ok_or(GuiError::ShowError)
.ok_or(GuiError::HideError)
}
}

Expand Down
4 changes: 2 additions & 2 deletions extensions/src/gui/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ impl<'a> Window<'a> {
/// Returns the window's handle as an X11 window handle, if this is an X11 window.
/// Otherwise, this returns `None`.
pub fn as_x11_handle(&self) -> Option<c_ulong> {
if self.api_type() == GuiApiType::COCOA {
// SAFETY: We just checked this was a COCOA window
if self.api_type() == GuiApiType::X11 {
// SAFETY: We just checked this was an X11 window
unsafe { Some(self.raw.specific.x11) }
} else {
None
Expand Down
4 changes: 2 additions & 2 deletions host/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ impl<H: HostHandlers> StartedPluginAudioProcessor<H> {
/// to jump backwards.
#[inline]
pub fn reset(&mut self) {
// SAFETY: This type ensures this can only be called in the main thread.
// SAFETY: This type ensures this can only be called on the audio thread.
unsafe { self.inner.reset() }
}

Expand Down Expand Up @@ -672,7 +672,7 @@ impl<H: HostHandlers> StoppedPluginAudioProcessor<H> {
/// to jump backwards.
#[inline]
pub fn reset(&mut self) {
// SAFETY: This type ensures this can only be called in the main thread.
// SAFETY: This type ensures this can only be called on the audio thread.
unsafe { self.inner.reset() }
}

Expand Down