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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,64afbf156d06bbe7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-01 05:44:43 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!not-for-mail Message-ID: <3F7ACC2E.1010804@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) 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> <3F79F5E5.9090408@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 01 Oct 2003 12:44:42 GMT NNTP-Posting-Host: 165.247.66.46 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1065012282 165.247.66.46 (Wed, 01 Oct 2003 05:44:42 PDT) NNTP-Posting-Date: Wed, 01 Oct 2003 05:44:42 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:64 Date: 2003-10-01T12:44:42+00:00 List-Id: O.K. From the perspective of the Standard, it may be undesirable to say too much or you stop someone from doing something useful in a given implementation environment. The down side of that, of course, is that you now have uncertain behavior - which rather defeats the purpose of having a standard, doesn't it? If there were a "Marins_Unchecked_Deallocation ()" subprogram, it would most likely return a flag indicating success or a count of the number of bytes freed - or maybe both. I'd just like to know if my call to Unchecked_Deallocation did me any good or was I just wasting my time & creating a potential memory leak that I couldn't see because the code looked like it was doing what I thought it should be doing. My way, if an implementation can't or won't reclaim the storage, I know that this happened. The ARM way, you have no clue if its any good except if the vendor documented what it does (and you could find it in the document!) The ARM way could also lead to non-portability, but my way would at least give the programmer a shot at writing portable code. MDC Robert I. Eachus wrote: > > 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. > > -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m c o n d i c @ a c m . o r g "All reformers, however strict their social conscience, live in houses just as big as they can pay for." --Logan Pearsall Smith ======================================================================