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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,75d2eb9e2e52a8c5,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!s41g2000prb.googlegroups.com!not-for-mail From: Rod Kay Newsgroups: comp.lang.ada Subject: Problem where a function is invoked once but called twice (when invocation is within an allocator). Date: Wed, 4 May 2011 20:52:06 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 110.174.207.98 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1304567526 2940 127.0.0.1 (5 May 2011 03:52:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 May 2011 03:52:06 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s41g2000prb.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: g2news2.google.com comp.lang.ada:20133 Date: 2011-05-04T20:52:06-07:00 List-Id: hi, Any clues on why the use of an allocator would cause a single function invocation to be called twice ? the_Movie : media.Video.view := new_Movie; the_next_Frame : openGL.Image := the_Movie.next_Frame; -- case 1 the_next_Frame : access openGL.Image := new opengl.Image' (the_Movie.next_Frame); -- case 2 In the 1st case, the 'next_Frame' function is called once. In the 2nd case, it is called twice. 'the_Movie' is an access to an object of tagged type 'media.Video.item'. package media.Video is type Item is tagged limited private; type View is access all Item; ... function next_Frame (Self : access Item) return opengl.Image; ... end media.Video; 'opengl.Image' is an array with two unconstrained indices ... package openGL is ... type Image is array (Index_t range <>, Index_t range <>) of Color; end openGL; In case it matters, the 'next_Frame' function contains a rendezvous with a decoder task. The decoder task is a component of the 'media.Video.item' record. regards, Rod.