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,start 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: Memory_Management Date: 18 Apr 2005 18:39:39 -0700 Organization: http://groups.google.com Message-ID: <6cf157bb.0504181739.5c9e1bbb@posting.google.com> NNTP-Posting-Host: 61.76.255.27 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1113874779 8330 127.0.0.1 (19 Apr 2005 01:39:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 19 Apr 2005 01:39:39 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:10555 Date: 2005-04-18T18:39:39-07:00 List-Id: with Ada.Finalization; with Memory_Management; package Pkg is My_Pool : Memory_Management.User_Pool(Size => 500); type My_Int is access Integer; for My_Int'Storage_Pool use My_Pool; type My_Data is new Ada.Finalization.Controlled with record Value : My_Int; end record; procedure Initialize(Data : in out My_Data); procedure Finalize(Data : in out My_Data); end Pkg; with Ada.Unchecked_Deallocation; package body Pkg is . . procedure Finalize(Data : in out My_Data) is begin Free(Data.Value); end Finalize; . . end Pkg; with Ada.Text_IO; with Ada.Finalization; with Pkg; procedure Fun is package TIO renames Ada.Text_IO; package AF renames Ada.Finalization; I1, I2 : Pkg.My_Data; I3 : Pkg.My_Int; begin I1 := (AF.Controlled with Value => new Integer'(123)); TIO.Put_Line(I1.Value.all'Img); I2 := (AF.Controlled with Value => new Integer'(456)); TIO.Put_Line(I2.Value.all'Img); I3 := new Integer'(789); TIO.Put_Line(I3.all'Img); end Fun; ===> I write some test code with Memory_Management package(http://www.adapower.com/index.php?Command=Class&ClassID=Advanced&CID=222) from Anh Vo fun.exe result is 0 0 789 and I1.Value'Address and I2.Value'Address is equal. I can not understand this result. My English is poor. Thank You.