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,e31963013a17b383 X-Google-Attributes: gid103376,public From: "David S. Gibson" Subject: Re: "Inefficiency" of controlled types Date: 1997/06/30 Message-ID: <33B7B7AF.BC80B16@cis.ohio-state.edu>#1/1 X-Deja-AN: 253617358 References: Organization: The Ohio State University Dept. of Computer and Info. Science Newsgroups: comp.lang.ada Date: 1997-06-30T00:00:00+00:00 List-Id: Matthew Heaney wrote: > > I'm curious about early in a derivation tree controlled types should be > introduced, given that there is some overhead in their use. . . . > However, we really only need this for unbounded forms, which use heap > allocation. For bounded forms (implemented as an array), finalization is > not really required, and so there is an "unnecessary" amount of overhead. > > We don't have to introduce Controlled that early in the hierarchy. Clients > that need it could declare a Controlled wrapper for that stack component > that requires finalization (say, a list component used to implement the > unbouned stack). When I was using controlled types for the same purpose, I found that I had to derive generic components from Ada.Finialization.Limited_Controlled at the root level due to the accessibility rules of Ada. If I recall correctly, an instance of a generic controlled type package needs to be declared as a library-level package. While I put the derivation from Limited_Controlled in the private part, I would have liked to move it down some in the hierarchy. Dave -- dgibson@cis.ohio-state.edu