Lines Matching refs:control

554 static block_header_t * search_suitable_block(control_t * control, int * fli, int * sli)  in search_suitable_block()  argument
563 unsigned int sl_map = control->sl_bitmap[fl] & (~0U << sl); in search_suitable_block()
566 const unsigned int fl_map = control->fl_bitmap & (~0U << (fl + 1)); in search_suitable_block()
574 sl_map = control->sl_bitmap[fl]; in search_suitable_block()
581 return control->blocks[fl][sl]; in search_suitable_block()
585 static void remove_free_block(control_t * control, block_header_t * block, int fl, int sl) in remove_free_block() argument
595 if(control->blocks[fl][sl] == block) { in remove_free_block()
596 control->blocks[fl][sl] = next; in remove_free_block()
599 if(next == &control->block_null) { in remove_free_block()
600 control->sl_bitmap[fl] &= ~(1U << sl); in remove_free_block()
603 if(!control->sl_bitmap[fl]) { in remove_free_block()
604 control->fl_bitmap &= ~(1U << fl); in remove_free_block()
611 static void insert_free_block(control_t * control, block_header_t * block, int fl, int sl) in insert_free_block() argument
613 block_header_t * current = control->blocks[fl][sl]; in insert_free_block()
617 block->prev_free = &control->block_null; in insert_free_block()
626 control->blocks[fl][sl] = block; in insert_free_block()
627 control->fl_bitmap |= (1U << fl); in insert_free_block()
628 control->sl_bitmap[fl] |= (1U << sl); in insert_free_block()
632 static void block_remove(control_t * control, block_header_t * block) in block_remove() argument
636 remove_free_block(control, block, fl, sl); in block_remove()
640 static void block_insert(control_t * control, block_header_t * block) in block_insert() argument
644 insert_free_block(control, block, fl, sl); in block_insert()
685 static block_header_t * block_merge_prev(control_t * control, block_header_t * block) in block_merge_prev() argument
691 block_remove(control, prev); in block_merge_prev()
699 static block_header_t * block_merge_next(control_t * control, block_header_t * block) in block_merge_next() argument
706 block_remove(control, next); in block_merge_next()
714 static void block_trim_free(control_t * control, block_header_t * block, size_t size) in block_trim_free() argument
721 block_insert(control, remaining_block); in block_trim_free()
726 static void block_trim_used(control_t * control, block_header_t * block, size_t size) in block_trim_used() argument
734 remaining_block = block_merge_next(control, remaining_block); in block_trim_used()
735 block_insert(control, remaining_block); in block_trim_used()
739 static block_header_t * block_trim_free_leading(control_t * control, block_header_t * block, size_t… in block_trim_free_leading() argument
748 block_insert(control, block); in block_trim_free_leading()
754 static block_header_t * block_locate_free(control_t * control, size_t size) in block_locate_free() argument
769 block = search_suitable_block(control, &fl, &sl); in block_locate_free()
775 remove_free_block(control, block, fl, sl); in block_locate_free()
781 static void * block_prepare_used(control_t * control, block_header_t * block, size_t size) in block_prepare_used() argument
786 block_trim_free(control, block, size); in block_prepare_used()
794 static void control_constructor(control_t * control) in control_constructor() argument
798 control->block_null.next_free = &control->block_null; in control_constructor()
799 control->block_null.prev_free = &control->block_null; in control_constructor()
801 control->fl_bitmap = 0; in control_constructor()
803 control->sl_bitmap[i] = 0; in control_constructor()
805 control->blocks[i][j] = &control->block_null; in control_constructor()
842 control_t * control = tlsf_cast(control_t *, tlsf); in lv_tlsf_check() local
848 const int fl_map = control->fl_bitmap & (1U << i); in lv_tlsf_check()
849 const int sl_list = control->sl_bitmap[i]; in lv_tlsf_check()
851 const block_header_t * block = control->blocks[i][j]; in lv_tlsf_check()
859 tlsf_insist(block == &control->block_null && "block list must be null"); in lv_tlsf_check()
865 tlsf_insist(block != &control->block_null && "block should not be null"); in lv_tlsf_check()
867 while(block != &control->block_null) { in lv_tlsf_check()
1016 control_t * control = tlsf_cast(control_t *, tlsf); in lv_tlsf_remove_pool() local
1026 remove_free_block(control, block, fl, sl); in lv_tlsf_remove_pool()
1099 control_t * control = tlsf_cast(control_t *, tlsf); in lv_tlsf_malloc() local
1101 block_header_t * block = block_locate_free(control, adjust); in lv_tlsf_malloc()
1102 return block_prepare_used(control, block, adjust); in lv_tlsf_malloc()
1107 control_t * control = tlsf_cast(control_t *, tlsf); in lv_tlsf_memalign() local
1127 block_header_t * block = block_locate_free(control, aligned_size); in lv_tlsf_memalign()
1152 block = block_trim_free_leading(control, block, gap); in lv_tlsf_memalign()
1156 return block_prepare_used(control, block, adjust); in lv_tlsf_memalign()
1164 control_t * control = tlsf_cast(control_t *, tlsf); in lv_tlsf_free() local
1169 block = block_merge_prev(control, block); in lv_tlsf_free()
1170 block = block_merge_next(control, block); in lv_tlsf_free()
1171 block_insert(control, block); in lv_tlsf_free()
1192 control_t * control = tlsf_cast(control_t *, tlsf); in lv_tlsf_realloc() local
1232 block_merge_next(control, block); in lv_tlsf_realloc()
1237 block_trim_used(control, block, adjust); in lv_tlsf_realloc()