comp.lang.ada
 help / color / mirror / Atom feed
* Re: Great Circle and Ada?
@ 1996-09-17  0:00 Lars Farm
  1996-09-17  0:00 ` Robert A Duff
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Farm @ 1996-09-17  0:00 UTC (permalink / raw)



Robert Dewar <dewar@cs.nyu.edu> wrote:

> An obvious counter-example is the use of virtual
> origins to reference dynamically allocated arrays.

What is virtual origin? Somewhere there has to be a way to reach the block
from users code if one is to use it. Is is a pointer into the interior of
an allocated block rather than to the start of the block? If so, at least
Boehms GC has no problems with it and Great Circle can probably handle
interior pointers too.


-- 
Lars Farm, lars.farm@ite.mh.se






^ permalink raw reply	[flat|nested] 6+ messages in thread
* Great Circle and Ada?
@ 1996-09-14  0:00 John G. Volan
  1996-09-15  0:00 ` Robert Dewar
  0 siblings, 1 reply; 6+ messages in thread
From: John G. Volan @ 1996-09-14  0:00 UTC (permalink / raw)



Anybody around here ever heard of Great Circle, an automatic garbage
collector for C/C++ produced by Geodesic? I just stumbled upon their
web-site: <http://www.geodesic.com/>  It's described as a conservative,
incremental, real-time, thread-safe (?) garbage collector that can be
transparently linked into existing software, without having to recompile
your code (it replaces the system default versions of malloc() and
free()
with its own versions -- apparently their version of free() does
nothing).
They claim that they can automatically eliminate all memory leaks and
all premature/multiple deallocation problems, even in third party
libraries (for instance, the notoriously leaky X/Motif library).

The name "Great Circle" reminds me of Henry Baker's work on real-time
incremental garbage collection. Can anybody tell me whether there's a
connection?

The "transparent" version of Great Circle is a conservative garbage
collector: It determines which heap-allocated objects are still
accessible,
by searching through memory for any 32-bit value that contains an
address
on the heap. Obviously, this scheme can miss some garbage if a
non-pointer bit-pattern happens to look like a heap address.

There's also a "wrapped" version of Great Circle that's faster and
more precise, but it requires you to rewrite your code to make use of 
a garbage collected "smart pointer" class template (this is only for
C++,
of course).

It seems to me that it would be fairly straightforward to use the
transparent form of Great Circle with the GNAT compiler. (The way I
understand it, GNAT translates an Ada allocator into a call to malloc(),
and Ada.Unchecked_Deallocation into free().)  Has anybody tried this,
and if so, what results did you get?

Another possibility, which would take a lot more work, would be to map
Ada access types into Great Circle smart pointers. (Maybe someone could
experiment with the GNAT compiler to do this. Anybody already at it?)
As long as a programmer remained within the abstractions of Ada and
didn't venture into Unchecked_Conversions etc., the garbage collector
would always know the location of every access value.

I'm wondering whether this product is in fact thread-safe. If so, 
does it perform correctly and/or efficiently in the presence of Ada95
tasking. They claim it's great for real time (a GC pause supposedly
can be reduced down to a microsecond), but I have my doubts.

------------------------------------------------------------------------
Internet.Usenet.Put_Signature 
  (Name => "John G. Volan",  Home_Email => "John_Volan@syspac.com",
   Employer => "S.A.I.C.",   Work_Email => "John_Volan@dayton.saic.com",
   Slogan => "Ada95: The World's *FIRST* International-Standard OOPL",
   Disclaimer => "My employer never defined these opinions, so using " &
     "them is totally erroneous...or is that a bounded error now? :-)");
------------------------------------------------------------------------




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-09-18  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-17  0:00 Great Circle and Ada? Lars Farm
1996-09-17  0:00 ` Robert A Duff
1996-09-17  0:00   ` Norman H. Cohen
1996-09-18  0:00     ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-09-14  0:00 John G. Volan
1996-09-15  0:00 ` Robert Dewar

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