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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,64afbf156d06bbe7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-30 14:30:38 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed.mathworks.com!wn13feed!wn11feed!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F79F5E5.9090408@comcast.net> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: 'Valid, subtypes and constraint checking - Thanks References: <3F74E844.1020001@comcast.net> <3F78F159.9040800@comcast.net> <3F797AD7.4@noplace.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc52.ops.asp.att.net 1064957437 24.34.139.183 (Tue, 30 Sep 2003 21:30:37 GMT) NNTP-Posting-Date: Tue, 30 Sep 2003 21:30:37 GMT Organization: Comcast Online Date: Tue, 30 Sep 2003 21:30:37 GMT Xref: archiver1.google.com comp.lang.ada:38 Date: 2003-09-30T21:30:37+00:00 List-Id: Marin David Condic wrote: > Perhaps in practice, most compilers have connected > Unchecked_Deallocation to some OS "free" routine. I suppose it is the > job of the vendor to document that and the job of the user to check that > this is the case. It would just be nice to have the standard guarantee > that it does this or at least provide a means to check that the > Unchecked_Deallocation actually *did* reclaim the storage. That way, > you'd know if you could count on it to do the job you'd expect it to do. First, let me agree that compilers should try to document what they do in this area. But it is harder than you might think. For example, what if I try to free a task that is not yet terminated? Perhaps the current task that is executing the call to Unchecked_Deallocation. Right now a compiler can refuse to do anything in such a case, and in fact, is expected to do nothing. (It can free SOME of the memory associated with the task, but not all.) Or a different example. If your compiler does provide a garbage collected heap, do you want Free to trump the garbage collector? (This would mean that the only time Free did something was when the object was still accessable...ouch! A better example is probably reference counted storage. There you want a call to Free to decrement the count by one, and release the storage if the count is equal to zero. Or let's imagine a 64-bit address space on a virtual memory machine. There could be a clever implementation of the heap which keeps a list of space that has been freed on pages that are currently non-resident. The memory manager could also decide to materialize a new page of memory for an allocation instead of paging in a page that has some free space, etc. Reasonable implementation of a heap? Sure. Should an Ada compiler be allowed to use such a heap on a system that provides it? Of course. There are other cases, but I think you get the picture. The reference manual is careful not to say too much. Vendor documentation can and should be much more forthcoming. -- Robert I. Eachus "Quality is the Buddha. Quality is scientific reality. Quality is the goal of Art. It remains to work these concepts into a practical, down-to-earth context, and for this there is nothing more practical or down-to-earth than what I have been talking about all along...the repair of an old motorcycle." -- from Zen and the Art of Motorcycle Maintenance by Robert Pirsig