comp.lang.ada
 help / color / mirror / Atom feed
From: Nick Roberts <nickroberts@callnetuk.com>
Subject: Re: Ada GC (was Ammo-zilla)
Date: 1999/11/04
Date: 1999-11-04T00:00:00+00:00	[thread overview]
Message-ID: <3820CF33.81C062E1@callnetuk.com> (raw)
In-Reply-To: s20tckqd24291@corp.supernews.com

Vladimir Olensky wrote:
> ...
> This restriction could be done using  language support for GC.
> Let's suppose that we have additional keyword TRACED
> that applied to the ACCESS TYPES controlled by GC.
> (This TRACED ACCESS TYPE could be bound
> to particular GC using standard Ada construct:
> for T'Storage_Pool use Ada.GC.GC_Name_Storage_Pool).
> 
> When access type is declared to be traced compiler should
> not allow any unchecked conversions with that type in standard
> mode.
> In may allowed only using  additional pragmas.

Rather than introducing a new reserved word into the Ada syntax, I think
all that would be necessary would be for a new standard (abstract) pool
type to be defined, derived from Root_Storage_Pool, called
Root_Managed_Pool, say. Managed (garbage collecting) pools would all be
derived from this type. I think Root_Managed_Pool would have at least
one extra primitive operation, to induce a garbage collection and/or
object compaction cycle.

In order to cause objects referenced by a certain access type to be
allocated into a managed pool, one would simply declare a Storage_Pool
representation clause for the access type, naming an object of the
appropriate managed pool type. Notice how this leaves implementations
free to choose to provide garbage collection by default or not (or to
select this by pragma, compiler switch, or other option).

It would then be the responsibility of the compiler to ensure that all
objects of this access type were 'traced', as Vladimir puts it. This
means, in practice, that: a type descriptor for the access type must be
entered into a 'type descriptor table'; every single object of the
access type must be entered into a 'frame object table'; every instance
of a value of the access type being loaded into or saved out of a
register must be entered into a 'register loading table'; every compound
type which can contain one or more values of a traced type is also
traced (and so on recursively). The three tables would form part of the
static data of the program, and would enable managed pools to determine
the size and alignment of every object they contain, and to move those
objects about in memory, correcting variables and registers as
necessary. In addition, the compiler must provide facilities (to the
pool managers) for identifying and freezing those tasks using a managed
pool, for reading from and writing to the stack frames and register sets
of those tasks, etc. (Or, to put it in simpler terms, no-one should be
in doubt as to the complexity of adding GC, nor, for that matter, to the
possibility of doing so.)

It may well behove a compiler to issue a serious warning for any use of
unchecked conversion, deallocation, or access for any traced type. But
ultimately, as ever, if the user (Ada programmer) screws up, after
having been so warned, he or she only has himself or herself to blame.

It would undoubtedly be very useful (and not overly difficult, I think)
for the implementor of a managed pool to provide an alternative
implementation or mode which (sacrificing some efficiency perhaps)
provided various (extra) profiling and debugging facilities relating to
the use of the pool.

It would be particularly incumbent upon the implementors of managed
pools to make special efforts to ensure the correctness of their
implementations, since the results of a garbage collector going wrong
are always likely to be particularly unfortunate.

-- 
Nick Roberts
Computer Consultant (UK)
http://www.callnetuk.com/home/nickroberts
http://www.adapower.com/lab/adaos






  parent reply	other threads:[~1999-11-04  0:00 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-23  0:00 Ammo-zilla Stanley R. Allen
1999-10-24  0:00 ` Ammo-zilla Robert Dewar
1999-10-24  0:00   ` Ammo-zilla David Botton
1999-10-24  0:00 ` Ammo-zilla Aidan Skinner
1999-10-24  0:00   ` Ammo-zilla Robert Dewar
1999-10-24  0:00     ` Ammo-zilla Matthew Heaney
1999-10-24  0:00     ` Ammo-zilla David Botton
1999-10-28  0:00       ` Ammo-zilla Charles Hixson
1999-10-28  0:00         ` Ammo-zilla Laurent Guerby
1999-10-28  0:00           ` Ammo-zilla David Starner
1999-10-29  0:00             ` Ammo-zilla Larry Kilgallen
1999-10-29  0:00               ` Ammo-zilla David Starner
1999-10-29  0:00                 ` Ammo-zilla Tucker Taft
1999-10-30  0:00                   ` Ammo-zilla Lutz Donnerhacke
1999-10-29  0:00                 ` Ammo-zilla David Botton
1999-10-29  0:00                   ` Ammo-zilla mike
1999-10-29  0:00                     ` Ammo-zilla David Botton
1999-10-31  0:00                     ` Ammo-zilla Robert Dewar
1999-11-02  0:00                       ` Ammo-zilla Charles Hixson
1999-11-03  0:00                         ` Ammo-zilla Wes Groleau
1999-11-01  0:00                     ` Ammo-zilla Geoff Bull
1999-10-29  0:00                 ` Ammo-zilla Matthew Heaney
1999-10-29  0:00                   ` Ammo-zilla Charles Hixson
1999-10-31  0:00                 ` Ammo-zilla Robert Dewar
1999-10-31  0:00                   ` Ammo-zilla David Starner
1999-11-01  0:00                     ` Ammo-zilla Robert Dewar
1999-11-01  0:00                     ` Ada and GC. Was: Ammo-zilla Vladimir Olensky
1999-11-01  0:00                       ` Vladimir Olensky
1999-11-01  0:00                       ` Tucker Taft
1999-11-02  0:00                         ` Vladimir Olensky
1999-11-02  0:00                         ` Robert Dewar
1999-11-02  0:00                           ` Charles Hixson
1999-11-03  0:00                             ` Robert Dewar
1999-11-03  0:00                               ` Charles Hixson
1999-11-01  0:00                     ` Ammo-zilla Robert Dewar
1999-11-01  0:00                   ` Ammo-zilla Robert A Duff
1999-11-01  0:00                     ` Ammo-zilla Vladimir Olensky
1999-11-01  0:00                     ` Ammo-zilla Robert Dewar
1999-11-02  0:00                       ` Ammo-zilla Robert A Duff
1999-11-02  0:00                         ` Ammo-zilla Robert Dewar
1999-11-03  0:00                           ` Ammo-zilla Vladimir Olensky
1999-11-03  0:00                             ` Ammo-zilla Robert Dewar
1999-11-04  0:00                               ` Ada GC (was Re: Ammo-zilla) Vladimir Olensky
1999-11-06  0:00                                 ` Robert Dewar
1999-11-06  0:00                                   ` Vladimir Olensky
1999-11-06  0:00                                     ` Robert Dewar
1999-11-06  0:00                                     ` Vladimir Olensky
1999-11-09  0:00                                     ` Robert A Duff
1999-11-10  0:00                                       ` Vladimir Olensky
1999-11-10  0:00                                         ` Richard D Riehle
1999-11-10  0:00                                           ` Nick Roberts
1999-11-12  0:00                                             ` Robert I. Eachus
1999-11-12  0:00                                               ` Didier Utheza
1999-11-12  0:00                                             ` Robert Dewar
1999-11-10  0:00                                           ` Robert A Duff
1999-11-12  0:00                                           ` Robert I. Eachus
1999-11-04  0:00                             ` Nick Roberts [this message]
1999-11-04  0:00                               ` Ada GC (was Ammo-zilla) Wes Groleau
1999-10-31  0:00                 ` Ammo-zilla Robert Dewar
1999-10-31  0:00                   ` Garbage colletion Lutz Donnerhacke
1999-11-01  0:00                     ` Robert Dewar
1999-11-01  0:00                       ` Lutz Donnerhacke
1999-11-01  0:00                     ` Larry Kilgallen
1999-11-01  0:00                     ` Robert Dewar
1999-11-01  0:00                       ` Gnat IDE (was: Garbage colletion) Ted Dennison
1999-11-01  0:00                       ` Garbage colletion Lutz Donnerhacke
1999-11-01  0:00                         ` Robert Dewar
1999-11-04  0:00                           ` Didier Utheza
1999-11-04  0:00                             ` David Starner
1999-10-30  0:00             ` Ammo-zilla Lutz Donnerhacke
1999-10-30  0:00               ` Ammo-zilla Matthew Heaney
1999-10-31  0:00             ` Ammo-zilla Robert Dewar
1999-10-28  0:00           ` Ammo-zilla Charles Hixson
1999-10-29  0:00             ` Ada and GC (Was Re: Ammo-zilla) Vladimir Olensky
1999-10-29  0:00               ` David Botton
1999-10-31  0:00                 ` Vladimir Olensky
1999-10-30  0:00                   ` Samuel T. Harris
1999-10-30  0:00                     ` David Botton
1999-10-29  0:00           ` Ammo-zilla Robert I. Eachus
1999-10-28  0:00         ` Ammo-zilla Tucker Taft
1999-10-31  0:00           ` Ammo-zilla Brian Rogoff
1999-11-01  0:00             ` Ammo-zilla Robert Dewar
1999-11-01  0:00               ` Ammo-zilla Brian Rogoff
1999-11-02  0:00                 ` Ammo-zilla Robert Dewar
1999-11-02  0:00                   ` Ammo-zilla Brian Rogoff
1999-11-02  0:00               ` Ammo-zilla Robert A Duff
1999-10-28  0:00         ` Ammo-zilla Matthew Heaney
1999-10-28  0:00           ` Ammo-zilla mitch
1999-10-29  0:00             ` Ammo-zilla Matthew Heaney
1999-10-31  0:00         ` Ammo-zilla Robert Dewar
1999-10-24  0:00     ` Ammo-zilla Aidan Skinner
1999-10-25  0:00       ` Ammo-zilla Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox