Memory Management
The eRTOS kernel, USB components, networking components, and each process has two memory allocation spaces (MSpaces): an internal MSpace used for internal kernel objects and bookkeeping, and a configurable external MSpace used for explicit-process memory allocation. Within each allocation space, there is a local pool and a pool cache to fulfill various memory requests. The local pool is used to deterministically fulfill the memory request from pool cache or directly fulfill requests from the application when larger memory amounts are allocated. The pool cache is used to speed up allocating/freeing of small size requests. It acts as an allocator’s cache with a configurable granularity of memory blocks, which are allocated from local pool.
You can allocate (reserve) an initial amount of memory in advance in the external allocation space of a process at its startup. Otherwise, memory will be allocated on the application’s first memory allocation call. A real-time application that allocates memory from the local pool or pool cache will receive memory deterministically as long as the local pool has enough memory available.