/* Function to get the category of the block of size 'size' or block number 'block_index'.  */
static __INLINE uint32_t get_block_cat(uint32_t size, uint32_t block_index)
/* Function to get the category of the block of size 'size' or block number 'block_index'.  */
static __INLINE uint32_t get_block_cat(uint32_t size, uint32_t block_index)
{
    for (uint32_t block_cat = 0; block_cat < BLOCK_CAT_COUNT; block_cat++)
    {
        if (((size != 0) && (size <= m_block_size[block_cat]) &&
            (m_block_end[block_cat] != m_block_start[block_cat])) ||
            (block_index < m_block_end[block_cat]))
        {
            return block_cat;
        }
    }
    return 0;
}