inline function

Why is this function defined as inline and not a normal
 function?
__inline static MMI_BOOL mmi_fe_test_display_as_space(U32 ch)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (FONT_TEST_CONTROL_CHAR(ch) || FONT_TEST_SPACE_CHAR(ch))
    {
        return MMI_TRUE;
    }
    return MMI_FALSE;
}

Comments

  1. Inline functions are same as normal function but we declare as inline if their frequency is higher and size is small so as to avoid the context switch time.
    In Inline function their name is replaced by complete code corresponding to the function at compile time so there is no context switch during function call.

    ReplyDelete

Post a Comment

Popular posts from this blog