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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,5653f0bd43045b85 X-Google-Attributes: gid103376,public From: gisle@krake.ii.uib.no (Gisle S�lensminde) Subject: Re: garbage collection Date: 1999/08/18 Message-ID: #1/1 X-Deja-AN: 514287556 Content-Transfer-Encoding: 8bit References: <7pe93j$ehg$1@dailyplanet.wam.umd.edu> Organization: University of Bergen, Norway Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-18T00:00:00+00:00 List-Id: In article <7pe93j$ehg$1@dailyplanet.wam.umd.edu>, Ronald Ayoub wrote: >In the book "Programming in Ada 95" by Barnes he says: > >If an allocated object becomes inaccessbile becasue no declard objects refer >to it directly or indirectly then the storage it occupies may be reclaimed >so that it can be reused for other objects. An implementation may (but need >not) provide garbage collection for this. > >I need this to be clarified for me. If an implementation doesn't provide >garbage collection then that storage is forever lost, is that correct? Or >does this mean that it may not be garbage collected but when a call to new >is executed it is at that time scene as available. Please clarify. This seems >like a real bad idea not to have some form of garbage collection inforced. > >Ron This is one of the strange things with Ada. Nearly all textbooks are giving you the impression that garbage collection is common in Ada compilers, and that maybe some compilers not has implemented GC, since the standard allows an implemention to not implement it. The fact is that hardly any Ada compilers have GC. The only ones I know about is those targeted for java virtual machine bytecode, where the virtual machine implements GC. (appletmagic and soon? jgnat) The reason is of cause that GC not is desireable for most realtime systems, which is the traditional area for Ada, but for many other tasks, GC is a good thing. However, I miss GC less in Ada then in many other languages, because you are less dependent on dynamic memory then in most other languages, and controlled types can be used to automaticly free memory when they goes out of scope or are assigned to. -- Gisle S�lensminde ( gisle@ii.uib.no )