pub fn new(capacity: usize) -> RingBuffer {
    let mut buffer = fixed_buffer::FixedBuffer::alloc(capacity);
    buffer.resize(capacity);
    return RingBuffer {
      buffer: buffer,
      write_pos: AtomicU64::new(0),
      valid_data: AtomicU64::new(0),
      read_pos: AtomicU64::new(0),
      read_waker: AtomicWaker::new(),
      write_waker: AtomicWaker::new(),
      read_shutdown: AtomicBool::new(false),
      write_shutdown: AtomicBool::new(false),
    }; 
  }
/// Create a the memory will be released when the ringbuffer is destroyed
Create a the memory will be released when the ringbuffer is destroyed
Create a the memory will be released when the ringbuffer is destroyed
pub fn new(capacity: usize) -> RingBuffer {
    let mut buffer = fixed_buffer::FixedBuffer::alloc(capacity);
    buffer.resize(capacity);
    return RingBuffer {
      buffer: buffer,
      write_pos: AtomicU64::new(0),
      valid_data: AtomicU64::new(0),
      read_pos: AtomicU64::new(0),
      read_waker: AtomicWaker::new(),
      write_waker: AtomicWaker::new(),
      read_shutdown: AtomicBool::new(false),
      write_shutdown: AtomicBool::new(false),
    }; 
  }
pub fn new ( capacity : usize ) -> RingBuffer { let mut buffer = fixed_buffer :: FixedBuffer :: alloc ( capacity ) ; buffer . resize ( capacity ) ; return RingBuffer { buffer : buffer , write_pos : AtomicU64 :: new ( 0 ) , valid_data : AtomicU64 :: new ( 0 ) , read_pos : AtomicU64 :: new ( 0 ) , read_waker : AtomicWaker :: new ( ) , write_waker : AtomicWaker :: new ( ) , read_shutdown : AtomicBool :: new ( false ) , write_shutdown : AtomicBool :: new ( false ) , } ; }
Create a the memory will be released when the ringbuffer is destroyed
Create a the memory will be released when the ringbuffer is destroyed
capacity
usize