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: davidf@mks.com (David J. Fiander) Subject: Re: Representation clauses and records Date: 1997/12/18 Message-ID: #1/1 X-Deja-AN: 299455222 Sender: davidf@davidf-nt.mks.com References: <347000b1.4909762@news.geccs.gecm.com> <349646A2.1A013246@alphalink.com.au> <1997Dec16.061148.1@eisner> <34979C4A.3C2D3D71@alphalink.com.au> Organization: Mortice Kern Systems Inc. Newsgroups: comp.lang.ada Date: 1997-12-18T00:00:00+00:00 List-Id: 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?" 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. - David