/* Give a buffer with the given to use during drawing. Be careful to not use the buffer while other processes are using it.  */
void* lv_draw_get_buf(uint32_t size)
/* Give a buffer with the given to use during drawing. Be careful to not use the buffer while other processes are using it.  */
void* lv_draw_get_buf(uint32_t size)
{
    if(size <= draw_buf_size) return LV_GC_ROOT(_lv_draw_buf);
    LV_LOG_TRACE("lv_draw_get_buf: allocate");
    draw_buf_size = size;
    if(LV_GC_ROOT(_lv_draw_buf) == NULL) {
        LV_GC_ROOT(_lv_draw_buf) = lv_mem_alloc(size);
        lv_mem_assert(LV_GC_ROOT(_lv_draw_buf));
        return LV_GC_ROOT(_lv_draw_buf);
    }
    LV_GC_ROOT(_lv_draw_buf) = lv_mem_realloc(LV_GC_ROOT(_lv_draw_buf), size);
    lv_mem_assert(LV_GC_ROOT(_lv_draw_buf));
    return LV_GC_ROOT(_lv_draw_buf);
}