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-Thread: a07f3367d7,8e11100f675ea2df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.72.99 with SMTP id c3mr10946332pav.28.1357876342241; Thu, 10 Jan 2013 19:52:22 -0800 (PST) MIME-Version: 1.0 Path: 6ni100175pbd.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: asynchronous task communication Date: Mon, 7 Jan 2013 00:38:42 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: Tr4YF43EK2s0RuphVpEIMQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader X-Received-Bytes: 1683 Date: 2013-01-07T00:38:42+00:00 List-Id: > (I *do* need to deallocate the vectors, though. You can manually deallocate things you allocated with "new", but usually one finds there's a LIFO structure to the allocation and deallocation, so in Ada you don't usually "allocate" or "deallocate" but rather you declare an object (in a block or a subprogram) and let the system clean up when you leave the block/subprogram. procedure sub is x1, x2 : some_kind_of_object; ... begin ... end sub; The system will "allocate" x1 and x2 on entry to the subprogram and automatically "deallocate" them on exit. If "some_kind_of_object" is a "controlled type" then you can write a "Finalize" procedure for that type which the system will call on the way out of the subprogram. If "some_kind_of_object" isn't itself controlled, but is, say, an array or record or something containing object(s) of controlled type, the Finalize for the individual entries will be called as part of exiting the subprogram.