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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3498dd887729ed19 X-Google-Attributes: gid103376,public From: Jonas Nygren Subject: Re: Garbage Collection in Ada Date: 1996/10/30 Message-ID: <32771A0A.32F6@ehs.ericsson.se>#1/1 X-Deja-AN: 193136245 references: <199610181934142408603@dialup101-3-15.swipnet.se> content-type: text/plain; charset=us-ascii organization: Ericsson Hewlett-Packard Telecommunications AB mime-version: 1.0 reply-to: ehsjony@ehs.ericsson.se newsgroups: comp.lang.ada x-mailer: Mozilla 3.0 (WinNT; I) Date: 1996-10-30T00:00:00+00:00 List-Id: Jon S Anthony wrote: > > In article Richard Riehle writes: > > While it is true that Root_Storage_Pool is derived > > from Ada.Finalization.Limited_Controlled, this should not be > > a particular hardship when control over the storage pool, > > and automatic garbage collection are essential to a given design. > > The keys are being able to > > a) tie an access type to a pool > b) define a type which cannot be allocated except by user defined constructor > (limited type with unknown discriminants). This gurantees that a) is the > only access type a client can use for the type. > c) ability to redefine _new_ for the pool > > to a much lesser extent: d) ability to redefine manual deallocation for pool. > > Finalization for the pool could also be useful (though only in special > cases) > I don't understand this. Can storage pools replace automatic garbage collection? How should one use storage pools to accomplish this? To me GC solves the problem of deallocation when there are two or more references to the same object. Without GC this is a difficult problem to solve, specially so in very large programs, where you have the problem of possible dangling pointers. I have tried Java a bit and recommend it to NO-GC advocates, it is rather refreshing not to have to think about deallocation. You should try it. /jonas