[FFmpeg-devel] [PATCH] lavu/attributes: add av_never_inline macro

James Almer jamrial at gmail.com
Wed Apr 12 23:41:44 EEST 2017


On 4/12/2017 5:10 PM, Rostislav Pehlivanov wrote:
> Very useful for determining hot functions without recompiling everything
> with inlining disabled.

If it's only useful for developers, then it shouldn't be a public
attribute.

Add it to internal.h, like with attribute_align_arg and av_export.

> 
> Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> ---
>  libavutil/attributes.h | 10 ++++++++++
>  libavutil/version.h    |  2 +-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
> index 54d1901116..d62f54a834 100644
> --- a/libavutil/attributes.h
> +++ b/libavutil/attributes.h
> @@ -44,6 +44,16 @@
>  #endif
>  #endif
>  
> +#ifndef av_never_inline
> +#if AV_GCC_VERSION_AT_LEAST(3,1)
> +#    define av_never_inline __attribute__((noinline))
> +#elif defined(_MSC_VER)
> +#    define av_never_inline __declspec(noinline)
> +#else
> +#    define av_never_inline
> +#endif
> +#endif
> +
>  #ifndef av_extern_inline
>  #if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
>  #    define av_extern_inline extern inline
> diff --git a/libavutil/version.h b/libavutil/version.h
> index bba39e0180..90d9137e08 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -79,7 +79,7 @@
>   */
>  
>  #define LIBAVUTIL_VERSION_MAJOR  55
> -#define LIBAVUTIL_VERSION_MINOR  61
> +#define LIBAVUTIL_VERSION_MINOR  62
>  #define LIBAVUTIL_VERSION_MICRO 100
>  
>  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
> 



More information about the ffmpeg-devel mailing list