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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to =?utf-8?Q?=E2=80=9Ccross?= the =?utf-8?Q?ch?= =?utf-8?Q?asm=E2=80=9D=3F?= Date: Sat, 05 May 2018 13:02:27 -0700 Organization: A noiseless patient Spider Message-ID: <87h8nl50rw.fsf@nightsong.com> References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <878t9nemrl.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="a1b938f69dddc3836c7a58a524d03b55"; logging-data="16412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19J0jvqtVzvuKa2KTCa3sAL" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:cIGhnXImr18AZuyhpFAIVhozmZI= sha1:s0xgV/K1t865GZ4QIVrqFk71C2I= Xref: reader02.eternal-september.org comp.lang.ada:52015 Date: 2018-05-05T13:02:27-07:00 List-Id: Simon Wright writes: > OK, there may be no dynamic (heap) allocation in restricted secondary > stack, but since it's allocated as part of the task stack you'd have a > hard row to hoe proving that it won't overflow! Lick a finger and > hope. ... > https://gcc.gnu.org/onlinedocs/gnat_rm/No_005fSecondary_005fStack.html Actually I don't understand why there is a secondary stack? In C++ such objects are placed on the primary stack, which afaict works out about the same way. If the object size is statically known (and recursion is not allowed or is restricted to a known depth) then with luck one can prove that the stack won't overflow. If the size is unknown then a secondary stack doesn't seem to help.