Skip to content

Memory Behavior Analysis

Malachi edited this page Jul 6, 2018 · 2 revisions

Since the crux of this library's existence rests on proper memory management, here's a diagram of the estd and embr library interaction for memory management, on which coap/cbor encoders & decoders rest:

Encoders and Decoders at their base operate on 'chunks' of memory which you spoon feed them. They are generally smart enough to handle partial chunks, and can resume when you feed them the next chunk - even in the middle of an involved state discovery.

Layered on top of this, we have NetBufEncoders and NetBufDecoders which shuttle the memory thru netbufs, so that you don't need to spoonfeed. Note that especially with NetBufDecoder, many pauses still take place so that state inspection may occur.

Finally, there's still being developed a NetBufDecoderSubject of sorts, which more or less takes callbacks from NetBufDecoder, so that you never have to pause. This has gone through many gyrations, and while the dust appears to be settling, it's the least ready of all the pieces

Clone this wiki locally