Replies: 1 comment
-
The idea is to keep the API flexible and allow each platform to do what they want (use heap-allocated buffer, static allocation, pool-based allocation, etc.). As an example, the existing code already provides |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I was curious about the reasoning for the
otInstanceInit(aBuf, aLen)
function. What is the benefit for providing the memory from outside during initialisation instead of calling justotPlatCAlloc
internally. I am quite curious if there was an acutal use case which created a benefit.Going through the history, when the init function was provided, there was no calloc function available, so that made sense (https://github.com/openthread/openthread/tree/ffbe65c6ddfaa385f4028e9c85fbc46507dfcfbc/).
But later, it looked like there was shortly the init call with an internal calloc call available, seemingly for a windows adaption. But this got removed. (74a95f0#diff-ec6274e9d4b1f741e41b679089675898c64b8a1644a0546a5010ef13fcb7bce5R233)
Thank you for the explanation.
Beta Was this translation helpful? Give feedback.
All reactions