On 20 January 2015 at 11:17, Leonard Bush <[email protected]> wrote:

> I have platform implementation of functions that I want in-lined.
>
> I write the function with this:  __attribute__((always_inline))
> I run gcc with these CFLAGS:
>  -Wno-attributes  (needed since I define attributes!)
>  -flto and -O3 (so these functions will be in-lined, if possible, at link
> time)
>
> The linking is noticeably slower, but there is a material performance
> benefit
> in the run-time of my ODP application.
>
> I do not know how this might fit into the ODP architecture,


Nothing prohibits it that I can think of right now


> but I find it
> much easier to implement and support than restricting inline to static
> functions in single files or "inline" header files.
> Thanks, Leonard.
>

I experimented and did this in the src file not the prototype in the public
API header file

inline __attribute__((always_inline)) int odp_init_global(odp_init_t
*params  ODP_UNUSED, odp_platform_init_t *platform_params ODP_UNUSED)

It compiled without warning and runs fine, the upshot may be that this is
something that can be entirely hidden in the implementation as needed, but
I did not confirm that the resulting executables did benefit

A little poking says we may want -funit-at-a-time to avoid warnings based
on optimization level see
https://gcc.gnu.org/ml/gcc-help/2007-01/msg00051.html


[1] https://gcc.gnu.org/onlinedocs/gcc/Inline.html



>
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp
>



-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to