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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,44ada043789a561c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!not-for-mail From: fracttcarf@yahoo.co.kr (Bini) Newsgroups: comp.lang.ada Subject: Re: Memory_Management Date: 19 Apr 2005 18:06:01 -0700 Organization: http://groups.google.com Message-ID: <6cf157bb.0504191706.58f199ba@posting.google.com> References: <6cf157bb.0504181739.5c9e1bbb@posting.google.com> NNTP-Posting-Host: 61.76.255.21 Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1113959161 4392 127.0.0.1 (20 Apr 2005 01:06:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 20 Apr 2005 01:06:01 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:10599 Date: 2005-04-19T18:06:01-07:00 List-Id: Duncan Sands wrote in message news:... > Hi Bini, maybe what is happening is this: > > > I1 := (AF.Controlled with Value => new Integer'(123)); > > here the right-hand-side (RHS) is an object of My_Data type. > You assign it to I1, another object of My_Data type. After > the assignment, RHS is finalized. This frees the memory - the > same memory I1.Value is pointing to. In detail: > > (0) Memory is allocated to hold the integer 123. A pointer > to the memory is in RHS.Value. > (1) a bit-wise copy is made of RHS onto I1. I1.Value points > to the integer. > (2) Adjust is called on I1. Since you don't seem to have > defined Adjust, this does nothing. > (3) Finalize is called on RHS. This frees the memory holding > 123. Now I1.Value is pointing to freed memory. > > You then look at I1.Value.all, which could be anything. > > You need to define Adjust. > > All the best, > > Duncan. Ok. I understand. Thank you very much.