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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f1111f1bf805022b,start X-Google-Attributes: gid103376,public From: Andy Askey Subject: Unconstrained type Unchecked_Deallocation Date: 2000/03/05 Message-ID: #1/1 X-Deja-AN: 593587658 Content-Transfer-Encoding: 7bit Organization: MindSpring Enterprises X-Server-Date: 5 Mar 2000 23:17:38 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-03-05T23:17:38+00:00 List-Id: I have a byte array type that is used to generate byte-arrays dynamically. I want to dynamically deallocate these byte-arrays. Can I use the following to deallocate memory? If not, any suggestions? package tst_pkg is type Byte_Atype is array (integer range <>) of character; type Byte_Ptype is access Byte_Atype; procedure Free(The_Array : in out Byte_Ptype); end tst_pkg; package body tst_pkg is procedure Deallocate is new Ada.Unchecked_Deallocation( Byte_Atype, Byte_Ptype); procedure Free(The_Array : in out Byte_Ptype) is begin Deallocate(The_Array); end; end tst_pkg; The real question is will the Free procedure deallocate all the bytes allocated with the following? my_bytes : Byte_Ptype; begin my_bytes := new Byte_Atype(1..100); tst_pkg.Free(my_bytes); end; Thanx. Andy -- Andy Askey ajaskey@mindspring.com