src/memory/source/tlsf.cc
static void remove_free_block(control_t* control, block_header_t* block, int fl, int sl) {
    block_header_t* prev = block->prev_free;
    block_header_t* next = block->next_free;
    tlsf_assert(prev && "prev_free field can not be null");
    tlsf_assert(next && "next_free field can not be null");
    next->prev_free = prev;
    prev->next_free = next;

    /* If this block is the head of the free list, set new head. */
    if (control->blocks[fl][sl] == block) {
        control->blocks[fl][sl] = next;

        /* If the new head is null, clear the bitmap. */
        if (next == &control->block_null) {
            control->sl_bitmap[fl] &= ~(1 << sl);

            /* If the second bitmap is now empty, clear the fl bitmap. */
            if (!control->sl_bitmap[fl]) {
                control->fl_bitmap &= ~(1 << fl);
            }
        }
    }
}
/* Remove a free block from the free list.*/
Remove a free block from the free list.
Remove a free block from the free list .
static void remove_free_block(control_t* control, block_header_t* block, int fl, int sl) {
    block_header_t* prev = block->prev_free;
    block_header_t* next = block->next_free;
    tlsf_assert(prev && "prev_free field can not be null");
    tlsf_assert(next && "next_free field can not be null");
    next->prev_free = prev;
    prev->next_free = next;
    if (control->blocks[fl][sl] == block) {
        control->blocks[fl][sl] = next;
        if (next == &control->block_null) {
            control->sl_bitmap[fl] &= ~(1 << sl);
            if (!control->sl_bitmap[fl]) {
                control->fl_bitmap &= ~(1 << fl);
            }
        }
    }
}
static void remove_free_block ( control_t * control , block_header_t * block , int fl , int sl ) { block_header_t * prev = block -> prev_free ; block_header_t * next = block -> next_free ; tlsf_assert ( prev && " " ) ; tlsf_assert ( next && " " ) ; next -> prev_free = prev ; prev -> next_free = next ; if ( control -> blocks [ fl ] [ sl ] == block ) { control -> blocks [ fl ] [ sl ] = next ; if ( next == & control -> block_null ) { control -> sl_bitmap [ fl ] &= ~ ( 1 << sl ) ; if ( ! control -> sl_bitmap [ fl ] ) { control -> fl_bitmap &= ~ ( 1 << fl ) ; } } } }
Remove a free block from the free list.
Remove a free block from the free list .
/* If this block is the head of the free list, set new head. */ /* If the new head is null, clear the bitmap. */ /* If the second bitmap is now empty, clear the fl bitmap. */