1 /**
2  * @file lv_gc.h
3  *
4  */
5 
6 #ifndef LV_GC_H
7 #define LV_GC_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include <stdint.h>
17 #include <stdbool.h>
18 #include "lv_mem.h"
19 #include "lv_ll.h"
20 #include "lv_task.h"
21 #include "../lv_draw/lv_img_cache.h"
22 #include "../lv_draw/lv_draw_mask.h"
23 
24 /*********************
25  *      DEFINES
26  *********************/
27 
28 #define LV_ITERATE_ROOTS(f) \
29     f(lv_ll_t, _lv_task_ll)  /*Linked list to store the lv_tasks*/ \
30     f(lv_ll_t, _lv_disp_ll)  /*Linked list of screens*/            \
31     f(lv_ll_t, _lv_indev_ll) /*Linked list of screens*/            \
32     f(lv_ll_t, _lv_drv_ll)                                         \
33     f(lv_ll_t, _lv_file_ll)                                        \
34     f(lv_ll_t, _lv_anim_ll)                                        \
35     f(lv_ll_t, _lv_group_ll)                                       \
36     f(lv_ll_t, _lv_img_defoder_ll)                                 \
37     f(lv_ll_t, _lv_obj_style_trans_ll)                             \
38     f(lv_img_cache_entry_t*, _lv_img_cache_array)                  \
39     f(lv_task_t*, _lv_task_act)                                    \
40     f(lv_mem_buf_arr_t , _lv_mem_buf)                              \
41     f(_lv_draw_mask_saved_arr_t , _lv_draw_mask_list)              \
42     f(void * , _lv_theme_material_styles)                          \
43     f(void * , _lv_theme_template_styles)                          \
44     f(void * , _lv_theme_mono_styles)                              \
45     f(void * , _lv_theme_empty_styles)                             \
46     f(uint8_t *, _lv_font_decompr_buf)                             \
47 
48 
49 #define LV_DEFINE_ROOT(root_type, root_name) root_type root_name;
50 #define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT)
51 
52 #if LV_ENABLE_GC == 1
53 #if LV_MEM_CUSTOM != 1
54 #error "GC requires CUSTOM_MEM"
55 #endif /* LV_MEM_CUSTOM */
56 #else  /* LV_ENABLE_GC */
57 #define LV_GC_ROOT(x) x
58 #define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name;
59 LV_ITERATE_ROOTS(LV_EXTERN_ROOT)
60 #endif /* LV_ENABLE_GC */
61 
62 /**********************
63  *      TYPEDEFS
64  **********************/
65 
66 /**********************
67  * GLOBAL PROTOTYPES
68  **********************/
69 
70 void _lv_gc_clear_roots(void);
71 
72 /**********************
73  *      MACROS
74  **********************/
75 
76 #ifdef __cplusplus
77 } /* extern "C" */
78 #endif
79 
80 #endif /*LV_GC_H*/
81