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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,b99897135d6631cc X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: memory management and productivity Date: Thu, 24 Jun 2004 08:45:28 +0200 Organization: AdaCL Message-ID: <1161944.XWqgaf0AgZ@linux1.krischik.com> References: <40d15023$1_1@baen1673807.greenlnk.net> <40d69121$1_1@baen1673807.greenlnk.net> <40d932fe_1@baen1673807.greenlnk.net> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit X-Trace: news.t-online.com 1088062073 00 19224 ocCEXBpvYR1RlbL 040624 07:27:53 X-Complaints-To: usenet-abuse@t-online.de X-ID: SXyD1UZ6ge2eNwyPqo-b3pr5fFA0xb0Jz-DhT+OJLaOw+9q0C1e4wT User-Agent: KNode/0.7.7 Xref: g2news1.google.com comp.lang.ada:1846 Date: 2004-06-24T08:45:28+02:00 List-Id: Bj�rn Persson wrote: > David Starner wrote: > >> The only library garbage collectors I know about are conservative; they >> assume that every pointer-size chunk of accessible memory is a pointer, >> (unless it's in a block of data that was allocated with a special >> function that tells the GC there are no pointers in that data.) They >> don't move memory because you can't adjust pointers if you can't tell >> pointers from integers. A garbage collector that was part of the compiler >> could tell integers from pointers (that is, be a precise collector >> instead of a conservative collector) and could move items in memory >> (which many high-performance GCs do.) This makes easier, for example, for >> a compiler to scan only the new stuff, which has a shorter live time than >> the stuff the program has kept around for a while. The first may be more >> important; a misplaced integer could potentially hold several megabytes >> of garbage in memory. > > I see. For a language like Ada, something that can't tell a pointer from > an integer clearly isn't as good as it could be. I knew there had to be > some drawback with a garbage collector that works for C. :-) BTW: In an Ada dialect with a precise collector Unchecked_Convertion between Access and Address/Integer are likely not to work any more. And if you use Unchecked_Deallocation you need to use pragma Controlled as well. Both of which will break existing code :-(. Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com