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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Bounded String question Date: Mon, 7 Mar 2016 17:16:08 -0600 Organization: JSA Research & Innovation Message-ID: References: <7ba56b33-28d4-42d2-8b9b-5ad9f5beab8b@googlegroups.com> <87io597447.fsf@theworld.com> <87egfw7dnm.fsf@theworld.com> <56dc7e22$0$19749$426a34cc@news.free.fr> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1457392569 22013 24.196.82.226 (7 Mar 2016 23:16:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 7 Mar 2016 23:16:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:29698 Date: 2016-03-07T17:16:08-06:00 List-Id: "Xavier Petit" wrote in message news:56dc7e22$0$19749$426a34cc@news.free.fr... I don't know if this is relevant... > procedure Test_Bounded_String is > package Bounded_String is > type T (Max_Length : Natural := 100) is limited private; ...but a type like this can be completed with a non-limited type. That might prevent the compiler from applying a limited-only optimization. (Another way to say it is that this type is not inherently limited; non-limited views can exist of such types, and a non-limited view would need an allocate-the-max strategy [or a non-contiguous object].) You might try making this type tagged, as that would make it inherently limited and *might* allow the compiler to make the optimization. (Or it simply might not work for any private type - optimizations are just that, and it isn't always easy to apply them to partial views.) Otherwise, you'll have to forgo using a private type (ugh, I know). Randy.