Thanks Leonard. Just so I understand.
ODP API file declares function as today,without any attributes
odp_return_t odp_foo(...);
Your implementation of odp_foo() is written as:
odp_return_t odp_foo(...) __attribute__((always_inline))
{
...implementation of odp_foo()
}
Your makefile then specifies
-Wno-attributes -flto -O3
and this results in application calls to odp_foo() being inlined?
That sounds perfect and has the additional advantage of not requiring
header file gymnastics.
On Tue, Jan 20, 2015 at 10:17 AM, 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, 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.
>
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp