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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6c13cc000274246b X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Please Help. Date: 1997/09/20 Message-ID: #1/1 X-Deja-AN: 274183289 References: <01bcbcde$f8a425c0$ca70fe8c@default> <5vaude$q20$1@goanna.cs.rmit.edu.au> <5vbiid$luu$1@goanna.cs.rmit.edu.au> <34197042.7CFC@gsfc.nasa.gov> <341D4041.4AF8@gsfc.nasa.gov> <342005BE.5C4E@gsfc.nasa.gov> <3422BE2E.62B1@gsfc.nasa.gov> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-09-20T00:00:00+00:00 List-Id: Stephe says <<<> 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). <> 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.