diff --git a/src/lib.rs b/src/lib.rs index eb889ae..33198c1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -316,8 +316,12 @@ impl Drop for Buffer { /// If the requested queue size is larger than available memory (e.g. /// `capacity.next_power_of_two() * size_of::() > available memory` ), this function will abort /// with an OOM panic. +/// +/// If the type parameter is a zero-size type. pub fn make(capacity: usize) -> (Producer, Consumer) { + assert!(0 < std::mem::size_of::(), "zero-size types are not supported"); + let ptr = unsafe { allocate_buffer(capacity) }; let arc = Arc::new(Buffer{