/* TLSF utility functions. In most cases, these are direct translations of the documentation found in the white paper.  */
static void mapping_insert(size_t size, int *fli, int *sli)
/* TLSF utility functions. In most cases, these are direct translations of the documentation found in the white paper.  */
static void mapping_insert(size_t size, int *fli, int *sli)
{
    int fl, sl;
    if(size < SMALL_BLOCK_SIZE) {
        fl = 0;
        sl = tlsf_cast(int, size) / (SMALL_BLOCK_SIZE / SL_INDEX_COUNT);
    }
    else {
        fl = tlsf_fls_sizet(size);
        sl = tlsf_cast(int, size >> (fl - SL_INDEX_COUNT_LOG2)) ^ (1 << SL_INDEX_COUNT_LOG2);
        fl -= (FL_INDEX_SHIFT - 1);
    }
    *fli = fl;
    *sli = sl;
}