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.7 required=5.0 tests=BAYES_00,NORMAL_HTTP_TO_IP, NUMERIC_HTTP_ADDR autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,75d2eb9e2e52a8c5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!s16g2000prf.googlegroups.com!not-for-mail From: Rod Kay Newsgroups: comp.lang.ada Subject: Re: Problem where a function is invoked once but called twice (when invocation is within an allocator). Date: Thu, 5 May 2011 03:59:12 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 110.174.207.98 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1304593259 23627 127.0.0.1 (5 May 2011 11:00:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 May 2011 11:00:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s16g2000prf.googlegroups.com; posting-host=110.174.207.98; posting-account=Uqu8JwoAAADsGt83KB06QWEVsML1fPO7 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.04 Chromium/11.0.696.57 Chrome/11.0.696.57 Safari/534.24,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19169 Date: 2011-05-05T03:59:12-07:00 List-Id: On May 5, 6:22=A0pm, Yannick Duch=EAne (Hibou57) wrote: > > Rod, may be you should have a look at the produced assembly ? and post an= =A0 > excerpt here A good idea. I created a small test program ... with media.Video; with openGL; procedure Tester is the_Movie : media.Video.view :=3D media.Video.new_Video ("xyz.avi"); Case_1 : openGL.Image :=3D the_Movie.next_Frame; Case_2 : access openGL.Image :=3D new opengl.Image' (the_Movie.next_Frame); begin null; end; ... and generated the mixed ada/asm, which is here: http://109.74.196.91:8080/doubled_next_Frame_call_results.txt In brief, the mixed ada/asm shows next_Frame being called twice for Case_2 ... **** Case_2 : access openGL.Image :=3D new opengl.Image' (the_Movie.next_Frame); ... call media__video__next_frame ... call __gnat_malloc ... call media__video__next_frame ... call memcpy Hope this helps. regards.