WIP heap-allocated BBBuffer
Hi there,
I took a stab at #41 here. What's missing is a bbqueue::heap::FramedProducer and bbqueue::heap::FramedConsumer. Also I'm unsure of how you want to structure the crate in terms of heap vs globally-allocated/stack-allocated.
For heap-allocated framed producer/consumer, here's what I'm thinking:
- Move
framed::FramedProducerandframed::FramedConsumerintocommon, make them usecommon::Producer/common::Consumerinstead ofbbqueue::Producer/bbqueue::Consumer. - Export wrapped
bbqueue::FramedProducer/bbqueue::FramedConsumerwith lifetimes re-added. - Export wrapped
heap::FramedProducer/heap::FramedConsumerwith reference counter for dropping (duplicateheap::Producer/heap::Consumerdropping code.
If you like that plan I can go ahead an implement it.
I split the common code into a separate common module that has Producer<N> and Consumer<N> types without lifetimes. The bbbuffer module exports wrapped Producer<'a, N> and Consumer<'a, N> types with the lifetimes. The heap module exports wrapped Producer<N> and Consumer<N> types that include a reference counter to determine if the underlying ConstBBBuffer should be dropped when the producer/consumer is dropped.