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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9e5138de1ea5afeb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-06 07:15:22 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Using controlled types to trace program execution Date: Wed, 6 Mar 2002 10:20:51 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3C7B9007.FB5F257D@uk.thalesgroup.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:20859 Date: 2002-03-06T10:20:51-05:00 List-Id: "Nige" wrote in message news:3C7B9007.FB5F257D@uk.thalesgroup.com... > procedure Something is > > Here : Trace.Location ("Something"); > > begin > null; > end Something; Try this: with Ada.Finalization; package Trace is type Location (S : access String) is limited private; private type Location (S : access String) is new Ada.Finalization.Limited_Controlled with null record; procedure Initialize (L : in out Location); procedure Finalize (L : in out Location); end Trace; with Trace; procedure Op is S : aliased String := "Op"; Here : Trace.Location (S'Access); begin null; end; You have to declare the string object as aliased. You don't need heap for what you're trying to do.