Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!taumet!mike From: mike@taumet.com (Michael S. Ball) Newsgroups: comp.lang.c++ Subject: Re: Optimization of inline functions Message-ID: <646@taumet.com> Date: 31 Mar 91 16:54:06 GMT References: <1894@hpwala.wal.hp.com> Reply-To: mike@taumet.UUCP (Michael S. Ball) Distribution: usa Organization: Taumetric Corporation, San Diego Lines: 13 In article <1894@hpwala.wal.hp.com> boba@hpwarau.UUCP (Bob Alexander) writes: >getCounter() is an inline function, so I should be able to read counter with >no function call overhead. But Turbo C++ 1.0 seems to always compile it >as a CALL-ed function. This makes me feel guilty each time I want Perhaps you are compiling with debug. Since debugging inlined and possiblly optimized functions is extremely difficult, TD insists that inline functions be laid down as normal functions. Otherwise, TC++ will inline the function unless it contains some "forbidden" constructs it can't handle. In such cases it issues a warning. It always works when I do it. -- Michael S. Ball mike@taumet.com TauMetric Corporation (619)697-7607