comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Please Help.
Date: 1997/09/20
Date: 1997-09-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.874768601@merv> (raw)
In-Reply-To: 3422BE2E.62B1@gsfc.nasa.gov


Stephe says

<<<<In the context of an embedded system with (no virtual memory) that has
  to run forever? Then compacting (or not using dynamic strings) becomes a
  requirement.>>

Well first of all, in real life, I cannot imagine embedded systems using
dynamic strings in this manner at all. But even if they did, the conclusion
that compacting is required is plain wrong. There are many ways of avoiding
fragmentation. Here are a couple, there are many more sophisticated
ones of course.

   Agree not to allocate strings longer than 100 characters
   Allocate all strings 100 characters space regardless of length

   Represent dynamic strings as list of characters or chunks of
   characters with fixed chunk size.

End of story. Note that compacting has a lot of surprises. For example, people
often write something like:

   c_routine_put (something'address, ....);

and it is quite a surprise to have this blow up because the system happens
to do a compacting garbage collection between taking the address of something
and using it. 

Garbage collection is a very useful tool, but compacting garbage collectors
are basically inconsistent with low level coding of the type that is often
seen in embedded systems. So I think your idea that somehow embedded systems
might be especially interested in compacting garbage collectors is quite
wrong (and we have not even considered the issue of compacting intefering
with hard deadlines).

<<If I have a reasonable relationship with the compiler vendor, I should
  be able to get any information I need, without it being part of the Ada
  standard. But I feel strongly that this issue (compacting dynamic
  memory) is ignored by too many programmers, so I'd like to raise its
  visibility.>>

Well certainly in the case of GNAT, this is information you can find out
very rapidly by looking at the sources. The source of unbounded string
is right there in your Ada library, it should not take more than a few
minutes for you to see how it does things! 

You should demand sources of the runtime no matter whose compiler you
are using. It is an unacceptable risk to incorporate library routines
into your code without having access to the sources. We regard this
access as critical. The adherence to free software principles of free
availability of sources is critical for risk reduction in high reliability
systems.






  parent reply	other threads:[~1997-09-20  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  0:00 Please Help Ken
1997-09-09  0:00 ` Dale Stanbrough
1997-09-11  0:00   ` Robert Dewar
1997-09-12  0:00     ` Tristan Ludowyk
1997-09-12  0:00       ` Robert Dewar
1997-09-13  0:00         ` Matthew Heaney
1997-09-13  0:00           ` Dale Stanbrough
1997-09-12  0:00       ` Dale Stanbrough
1997-09-12  0:00         ` Stephen Leake
1997-09-13  0:00           ` Robert Dewar
1997-09-15  0:00             ` Stephen Leake
1997-09-15  0:00               ` Dale Stanbrough
1997-09-16  0:00               ` Robert Dewar
1997-09-17  0:00                 ` Stephen Leake
1997-09-18  0:00                   ` Robert Dewar
1997-09-19  0:00                     ` Stephen Leake
1997-09-19  0:00                       ` Robert S. White
1997-09-20  0:00                       ` Robert Dewar [this message]
1997-09-15  0:00     ` Richard A. O'Keefe
1997-09-16  0:00       ` Robert Dewar
1997-09-09  0:00 ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2001-10-25  6:55 please help Phosphorus
2001-10-25  8:22 ` Preben Randhol
2001-10-25 12:35 ` Marc A. Criley
replies disabled

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