From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,6405eefbf080daa6 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Is an RTOS Required for Ada? Date: 1999/05/20 Message-ID: <1999May20.180936.1@eisner>#1/1 X-Deja-AN: 480296946 X-Nntp-Posting-Host: eisner.decus.org References: <373B2927.7B22F898@pop.safetran.com> <19990514155120.03860.00000396@ng-cr1.aol.com> <7hmc18$jr6$1@nnrp1.deja.com> <7i15hp$mc2@ftp.kvaerner.com> <1999May20.112204.1@eisner> <3744657E.A04ABC52@online.no> X-Trace: news.decus.org 927238180 17237 KILGALLEN [216.44.122.34] Organization: LJK Software Reply-To: Kilgallen@eisner.decus.org.nospam Newsgroups: comp.lang.ada Date: 1999-05-20T00:00:00+00:00 List-Id: In article <3744657E.A04ABC52@online.no>, "Tarjei Tj�stheim Jensen" writes: > I seem to remember that function calls are supposed to eat > clock cycles and should if possible be avoided. > Especially in cases like this where I assume (I've not > checked this so I may be horribly wrong) this is a > frequent function call. It is hard to imagine the function call > being any saving in either time or space > over emitting the code inline. Some systems have tiered costs for function calls, depending on the degree of complexity you require for the interface. Certainly a function call can save space over a copy loop, depending on not only the instruction set but also the rest of the machine design (alignment, etc.) Is saving space worth it ? Some compilers let you choose between saving space and saving time. For copying a long string, I would think function call overhead would be lost in the noise. For copying a short string, obviously not. Is the string length known at compile time ? I prefer to shy away from criticizing a code generation algorithm until I have a specific program of my own that gets bitten by a problem. Larry Kilgallen