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 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Problem where a function is invoked once but called twice (when invocation is within an allocator). Date: Thu, 05 May 2011 07:43:08 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 5 May 2011 05:43:10 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="cJo7kSTQUrCFv2/D8KKtqw"; logging-data="18230"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18sQbGqV4bv2fkJSfaSRyyr" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:I53MVCW0HcbBaZFizLT23jc4v+0= Xref: g2news1.google.com comp.lang.ada:19163 Date: 2011-05-05T07:43:08+02:00 List-Id: Le 05/05/2011 05:52, Rod Kay a �crit : > 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. > Wouldn't Image be controlled by any chance? In that case, the assignment may involve the creation of an intermediate object -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00