Memory management in Contiki-OS -


i trying create port contiki-os lpc1347, , have question how memory handled in contiki. protothreads stack-less , no "real threads" used on same stack, static memory allocation. understand how protothreads work when new process initialized, how memory allocated , also, in case of event having data, how memory managed event data?

all required memory statically allocated during compilation/linkage. done process macro[1], allocates structure containing necessary information [2]. events, must allocate own memory, too[3].

it therefore not possible run same thread* or schedule same event twice.

* is, not using process macro.

[1] https://github.com/contiki-os/contiki/blob/5bede26b/core/sys/process.h#l301-311

[2] https://github.com/contiki-os/contiki/blob/5bede26b/core/sys/process.h#l315-326

[3] https://github.com/contiki-os/contiki/blob/5bede26b/core/sys/process.c#l62-66


Comments