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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b23661223cdab88a X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Representation clauses and records Date: 1997/12/18 Message-ID: #1/1 X-Deja-AN: 299481624 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1997-12-18T00:00:00+00:00 List-Id: David J. Fiander (davidf@mks.com) wrote: : Pascal MALAISE writes: : > As far as I know, this problem would not happen in full ADA because the : > instanciation of unchecked_conversion will be compiled as a call to : > something : > like memcpy, a procedure which does not make any assumption about : > alignment of arguments. : > We loose performance but gain reliability. : I've seen other comments that indicate that the runtime cost of a : call to Unchecked_Conversion is going to be a function call of : some sort, and I have just one question: "Why?" I have never seen an implementation that imposes function call overhead for unchecked-conversion. This sounds like an "urban myth" ;-). Unchecked conversion does involve making a copy, but not a function call. : It would seem to me that if I have an object of some sort, and I : call Unchecked_Conversion on it, if the type is small enough : (in C terms converting a pointer to an int), why shouldn't the : compiler just generate a "load ptr/store int" instruction : sequence? Now, for larger objects, the compiler will have to : perform a block move to effect the conversion, either via a : runtime library call or by open-coding the block move, but that : depends entirely on the H/W support for block moves. Right. Whether block moves/copies involve out-of-line code is independent of the use of unchecked-conversion. : - David -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA