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,73e5f80245e6297 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Chunks of finalized Date: 1997/10/03 Message-ID: #1/1 X-Deja-AN: 277657491 References: <6129sn$n91$1@goanna.cs.rmit.edu.au> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-10-03T00:00:00+00:00 List-Id: In article <6129sn$n91$1@goanna.cs.rmit.edu.au>, Richard A. O'Keefe wrote: >Let's consider a stack, that might grow very large, or might be quite >small. This is not an actual application, it's just the context for >what I want to understand. By the way, wouldn't a simpler stack implementation illustrate your question just as well? A record containing an array of elements, and an index of the top of the stack. The issue is that you want to finalize an element when the Top pointer is decremented, right? You can call Finalize explicitly, if you like. And Finalize operations should normally be implemented in such a way that they work properly when you finalize things twice. However, there's no way to explicitly say "finalize this thing, including all its subcomponents". This happens when you leave a procedure, or when you Unchecked_Deallocate, but you can't do it explicitly. If you made it an array of access-to-whatever, then you could Unchecked_Deallocate each component when necessary. But unfortunately I don't see any way to invoke finalization (including subcomponents) other than that. Does that answer your question? - Bob