Hello Mike,
On 29-12-12 04:34, Mike K wrote:
I've been using the LCD library lately and noticed that each additional
lcd_write_char() call adds to the data area used. The library shows that
the functions are all declared as "pragma inline". Do we need to do
this? It seems to defeat the purpose of reusable code. When I remove the
pragmas the code and data areas used drops dramatically and still
functions as expected.
I've experimented with 'pragma inline' in my programs and several
libraries, but I did not find THE best optimisation for all situations.
In general inline has advantage for short procedures with few arguments.
It'll save code memory and improve speed.
Without 'inline' instructions are needed to pass arguments and for
call/return (although the compiler optimizes returns frequently).
But it may not work out positively in all situations.
It would be nice to have a compiler option '-no-inline' which would
neutralize/switch-off all pragma inline directives.
It would even be nicer when the compiler would determine the best result.
BTW: I suspect that growth of data-memory is caused by using
-no-variable-reuse
Regards, Rob.
--
R. Hamerling, Netherlands --- http://www.robh.nl
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.