Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 54cc1bac authored by Sharvil Nanavati's avatar Sharvil Nanavati Committed by Andre Eisenbach
Browse files

Add a reference counted buffer implementation.

This implementation introduces the notion of a 'slice'. A slice is
simply a sub-buffer of the original buffer. Slices refer to their
parent buffer so no memory is copied and slice creation becomes an
O(1) operation. Although I'm introducing a new concept, in practice,
a slice is indistinguishable from a buffer (they share a type and
all operations).

I expect slices to be used heavily during packet construction. For
example, an RFCOMM implementation would request a buffer from the
L2CAP layer (which may in turn request a buffer from the HCI layer).
The L2CAP layer would reserve some space in the buffer for its header
and return a slice to the RFCOMM layer.
parent 0814caf3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment