zephyr/lib/gui/lvgl/lvgl_mem_kernel.c
Anas Nashif 08ee8b09ba cleanup: include/: move misc/mempool.h to sys/mempool.h
move misc/mempool.h to sys/mempool.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00

26 lines
472 B
C

/*
* Copyright (c) 2018 Jan Van Winkel <jan.van_winkel@dxplore.eu>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "lvgl_mem.h"
#include <zephyr.h>
#include <init.h>
#include <sys/mempool.h>
K_MEM_POOL_DEFINE(lvgl_mem_pool,
CONFIG_LVGL_MEM_POOL_MIN_SIZE,
CONFIG_LVGL_MEM_POOL_MAX_SIZE,
CONFIG_LVGL_MEM_POOL_NUMBER_BLOCKS, 4);
void *lvgl_malloc(size_t size)
{
return k_mem_pool_malloc(&lvgl_mem_pool, size);
}
void lvgl_free(void *ptr)
{
k_free(ptr);
}