Skip to content
Closed
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
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ impl<T> Drop for Buffer<T> {
/// If the requested queue size is larger than available memory (e.g.
/// `capacity.next_power_of_two() * size_of::<T>() > available memory` ), this function will abort
/// with an OOM panic.
///
/// If the type parameter is a zero-size type.
pub fn make<T>(capacity: usize) -> (Producer<T>, Consumer<T>) {

assert!(0 < std::mem::size_of::<T>(), "zero-size types are not supported");

let ptr = unsafe { allocate_buffer(capacity) };

let arc = Arc::new(Buffer{
Expand Down