comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada has garbage collection
Date: Tue, 24 Aug 2004 13:35:38 -0500
Date: 2004-08-24T13:35:38-05:00	[thread overview]
Message-ID: <Hu6dnbRnvareF7bcRVn-oA@megapath.net> (raw)
In-Reply-To: 87oel1j70l.fsf@deneb.enyo.de

"Florian Weimer" <fw@deneb.enyo.de> wrote in message
news:87oel1j70l.fsf@deneb.enyo.de...
> * Wes Groleau:
...
> > Of course, some problems/data structures almost demand
> > pointers, but with sensible encapsulation and package
> > designed, controlled types provide all the GC those things need.
>
> Of course you can implement an ownership policy manually (or some
> simple form of garbage collection like reference counting, especially
> if your data structures aren't cyclic).  This is a tedious task, and
> if you implement the wrong ownership policy, you often prevent code
> reuse.  It's quite a bit of work to make something completely safe
> against misuse.

Designing for reuse is hard, period. And expecting to reuse things without
that is folly. And, if you're designed for reuse, you *have to* make it safe
against misuse.

Claw does a lot of things that aren't strictly necessary in order to
eliminate or mitigate misuse. One example is that all of the entry calls
into the message task are timed entry calls; an exception is raised if they
aren't accepted in a reasonable time. That's done to prevent deadlock which
can occur when an operation is called during the rendezvous of a handler.

> Memory management errors are hard to debug.

True, but not if they aren't made in the first place. :-) The last two
memory leaks I had to debug turned out to be compiler errors -- the software
was correct, the compiler wasn't implementing it properly. And those were
the only ones in the last year.

Note that any sort of memory recovery is wasted effort in quick running
programs; Janus/Ada only tries to recover memory that could be reused during
a compilation (a very small proportion of the memory allocated); the
completion of a compilation pass ends all use of memory without any overhead
at all.

                          Randy.






  reply	other threads:[~2004-08-24 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-24  3:49 Ada has garbage collection Wes Groleau
2004-08-24  8:05 ` Florian Weimer
2004-08-24 18:35   ` Randy Brukardt [this message]
2004-08-24 18:41 ` Jean-Marc Bourguet
replies disabled

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