kernel: Add k_mem_pool compatibility layer on top of k_heap

Add a shim layer implementing the legacy k_mem_pool APIs backed by a
k_heap instead of the original implementation.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2020-04-03 15:39:25 -07:00 committed by Andrew Boie
commit 8f0959c7b1
6 changed files with 115 additions and 2 deletions

View file

@ -4692,6 +4692,14 @@ void k_heap_free(struct k_heap *h, void *mem);
* If the pool is to be accessed outside the module where it is defined, it
* can be declared via
*
* @note When CONFIG_MEM_POOL_HEAP_BACKEND is enabled, the k_mem_pool
* API is implemented on top of a k_heap, which is a more general
* purpose allocator which does not make the same promises about
* splitting or alignment detailed above. Blocks will be aligned only
* to the 8 byte chunk stride of the underlying heap and may point
* anywhere within the heap; they are not split into four as
* described.
*
* @code extern struct k_mem_pool <name>; @endcode
*
* @param name Name of the memory pool.