+1
−0
system/osi/include/buffer.h
0 → 100644
+56
−0
system/osi/src/buffer.c
0 → 100644
+99
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
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.