demikernel
demikernel copied to clipboard
[runtime] Add Functionality to Conceptual Buffer Type
The buffers we currently pass around everywhere can be created (either empty, or from a slice of an u8 array), adjusted (have an amount taken from the start), and trimmed (have an amount taken from the end). And that's it.
It would be nice if we could place these buffers on lists without having to allocate an extra wrapper for them (e.g. by having accessible next & previous link fields in the buffer structure).
It would also be nice if we could attach a small amount of data to the buffer for various purposes where we currently have to allocate a wrapping struct (e.g. the UnackedSegment type, which holds an "Instant" representing the transmission time).
All of the above could potentially apply to groups of buffers, so we could manipulate multiple memory allocations together as a unit (BSD stacks have mbuf chains, Windows NT has net buffer lists).
This would likely require integration with the memory allocator for peak efficiency.
Related Issue #173 extends the desired functionality further.
We also need to support splitting an existing buffer into two (preferably without copying any of the actual data).