Currently, buffers are created as shared_ptrs, then passed all over the place
(prior to this pr) The way they are created is as follows:
1) When a flowgraph is initialized, a buffer object is create to associate with the output port of that edge
2) The port stores a sptr to the buffer
3) work_io stores a sptr to the buffer that is available in the work() call
This PR puts the ownership of the buffer at the port object
1) The buffer object is created with unique_ptr
2) Ownership is moved to the port object in port.set_buffer (during flowgraph initialization)
3) work_io stores a raw pointer to the buffer, since the lifetime is tied to the block/port
This is probably pretty rough, but looking for overall guidance on where we can clean up the abuse of shared_ptrs
Currently, buffers are created as shared_ptrs, then passed all over the place
(prior to this pr) The way they are created is as follows: 1) When a flowgraph is initialized, a buffer object is create to associate with the output port of that edge 2) The port stores a sptr to the buffer 3) work_io stores a sptr to the buffer that is available in the work() call
This PR puts the ownership of the buffer at the port object 1) The buffer object is created with unique_ptr 2) Ownership is moved to the port object in port.set_buffer (during flowgraph initialization) 3) work_io stores a raw pointer to the buffer, since the lifetime is tied to the block/port
This is probably pretty rough, but looking for overall guidance on where we can clean up the abuse of shared_ptrs