2019-01-12 01:07:34 +02:00
|
|
|
/**
|
|
|
|
* @file lv_gc.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LV_GC_H
|
|
|
|
#define LV_GC_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "lv_mem.h"
|
|
|
|
#include "lv_ll.h"
|
2019-06-20 23:14:17 +02:00
|
|
|
#include "../lv_draw/lv_img_cache.h"
|
2019-09-11 06:47:52 +02:00
|
|
|
#include "../lv_draw/lv_draw.h"
|
2019-01-12 01:07:34 +02:00
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
|
|
|
|
2019-12-22 22:52:11 +01:00
|
|
|
|
2019-12-22 01:35:00 +02:00
|
|
|
#define LV_ITERATE_ROOTS(f) \
|
|
|
|
f(lv_ll_t, _lv_task_ll) /*Linked list to store the lv_tasks*/ \
|
|
|
|
f(lv_ll_t, _lv_disp_ll) /*Linked list of screens*/ \
|
|
|
|
f(lv_ll_t, _lv_indev_ll) /*Linked list of screens*/ \
|
|
|
|
f(lv_ll_t, _lv_drv_ll) \
|
|
|
|
f(lv_ll_t, _lv_file_ll) \
|
|
|
|
f(lv_ll_t, _lv_anim_ll) \
|
|
|
|
f(lv_ll_t, _lv_group_ll) \
|
|
|
|
f(lv_ll_t, _lv_img_defoder_ll) \
|
|
|
|
f(lv_img_cache_entry_t*, _lv_img_cache_array) \
|
|
|
|
f(void*, _lv_task_act) \
|
2019-12-22 22:52:11 +01:00
|
|
|
f(lv_mem_buf_t, _lv_mem_buf[LV_MEM_BUF_MAX_NUM]) \
|
2019-04-04 07:15:40 +02:00
|
|
|
|
2019-12-22 01:35:00 +02:00
|
|
|
#define LV_DEFINE_ROOT(root_type, root_name) root_type root_name;
|
|
|
|
#define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT)
|
2019-01-12 01:07:34 +02:00
|
|
|
|
|
|
|
#if LV_ENABLE_GC == 1
|
2019-04-04 07:15:40 +02:00
|
|
|
#if LV_MEM_CUSTOM != 1
|
|
|
|
#error "GC requires CUSTOM_MEM"
|
|
|
|
#endif /* LV_MEM_CUSTOM */
|
|
|
|
#else /* LV_ENABLE_GC */
|
|
|
|
#define LV_GC_ROOT(x) x
|
2019-12-22 01:35:00 +02:00
|
|
|
#define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name;
|
|
|
|
LV_ITERATE_ROOTS(LV_EXTERN_ROOT)
|
2019-01-12 01:07:34 +02:00
|
|
|
#endif /* LV_ENABLE_GC */
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
|
|
|
|
2019-12-22 01:35:00 +02:00
|
|
|
void lv_gc_clear_roots(void);
|
|
|
|
|
2019-01-12 01:07:34 +02:00
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /*LV_GC_H*/
|