Batch/At (if it wasn't broken, no worries I broke it :-) )

Dmitri Nikulin dnikulin at gmail.com
Mon Sep 4 16:04:44 PDT 2006


On 04 Sep 2006 12:36:28 GMT, Jamie <nospam at xxxxxxxxxxxxx> wrote:
I patched it, removed the macros and replaced them with functions
(to make debugging easier)
As an aside, if you want to preserve the inlinable nature of macros
but actually use functions, investigate explicit inlining. It can be a
pain because of how many compilers don't support it, but it's in the
standard, so it's really their fault.
http://developer.apple.com/documentation/developertools/gcc-4.0.1/gcc/Inline.html

The bonus is that they can be reduced to normal functions just by
changing compile flags.
It probably isn't necessary in this case, but it can really help
performance if you find yourself calling a small function too often,
or one that can be greatly reduced by inlining variables and so on.
Benchmarks alone will tell you if it helps, but I've found many cases
in which it does.
Note that it still takes much more sophistication to inline recursive
functions, but you can simulate this with an artificial stack anyway,
and overall the performance should be favorable.
---
Dmitri Nikulin
Centre for Synchrotron Science
Monash University
Victoria 3800, Australia
email: dnikulin at xxxxxxxxx





More information about the Kernel mailing list