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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,565ddc0e6b80e338 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!g4g2000hsf.googlegroups.com!not-for-mail From: jef.mangelschots@gmail.com Newsgroups: comp.lang.ada Subject: Re: copying data between memory locations Date: Tue, 04 Sep 2007 18:16:54 -0000 Organization: http://groups.google.com Message-ID: <1188929814.160464.273080@g4g2000hsf.googlegroups.com> References: <1188809968.217323.145640@r29g2000hsg.googlegroups.com> <46dbe442$1@news.post.ch> <1188921451.460758.74670@r34g2000hsd.googlegroups.com> NNTP-Posting-Host: 65.168.158.195 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1188929814 13094 127.0.0.1 (4 Sep 2007 18:16:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 4 Sep 2007 18:16:54 +0000 (UTC) In-Reply-To: <1188921451.460758.74670@r34g2000hsd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 USCUCPROXY Complaints-To: groups-abuse@google.com Injection-Info: g4g2000hsf.googlegroups.com; posting-host=65.168.158.195; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1738 Date: 2007-09-04T18:16:54+00:00 List-Id: Just a few words of clarification: I do work on and off on both Ada and C projects, so yes, I sometimes do tend to think in terms like "I would do that like this in C, how do I do it in Ada". It is an Ada83 project with a very short deadline. This section of code is non-vital. Hopefully our last new Ada83 project (Ada83 is dictated by the compiler we use. not because we want it). Next projects will be Ada95/2005 on a new platform with new compilers. The reason why I ask the question is because we typically never do this kind of stuff and do it in ways suggested in your replies, hence my question. Thanks for the answers though. We feel comfortable doing this because we know the size of that buffer exactly and typically build in at least 2 ways of guaranteeing no buffer overflow can occur. The reason we want to do this is because it will bloat the code significantly if we want to go through the regular channels to get the data in those buffers. It is easy for use to know their memory address and size because they are mapped to specific hardware locations. Some of your suggestions like "type byte_array is array( <> ) of byte;",we do use already. The fact that Ada95 has a feature that could help us out means that it isn't an unreasonable request. Unfortunately, Ada83 doesn't have it. The difficulty is in maintaining a reference to these buffers, which are located and maintained elsewhere, in an array of structures, and access them via these references in a generic way rather than directly via their implementation-specific interfaces. Thank you for the answers. regards Jef