Skip to content

Commit

Permalink
fix: MultiPool::get returns an overlap error when its appropriate
Browse files Browse the repository at this point in the history
PoolError::Overlap is returned when the buffer is bigger than the slot
and not the other way around.
  • Loading branch information
snakedye authored and wash2 committed Dec 29, 2023
1 parent 6e4b95c commit da3e5c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shm/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl<K> MultiPool<K> {
let size = (stride * height) as usize;
let buf_slot = self.buffer_list.get_mut(index).ok_or(PoolError::NotFound)?;

if buf_slot.size > size {
if size > buf_slot.size {
return Err(PoolError::Overlap);
}

Expand Down

0 comments on commit da3e5c5

Please sign in to comment.