Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.misty.com!news.iecc.com!.POSTED!nerds-end From: "Robin Vowels" Newsgroups: comp.compilers Subject: Re: Historical Implementations to Garbage Collectors Date: Wed, 21 May 2014 18:37:33 +1000 Organization: Compilers Central Lines: 35 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-05-025@comp.compilers> References: <14-05-001@comp.compilers> <14-05-009@comp.compilers> <14-05-012@comp.compilers> <14-05-017@comp.compilers> <14-05-021@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1400717589 31009 2001:470:1f07:1126:0:676f:7373:6970 (22 May 2014 00:13:09 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Thu, 22 May 2014 00:13:09 +0000 (UTC) Keywords: storage, history Posted-Date: 21 May 2014 20:13:09 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1250 From: "George Neuner" > Our esteemed moderator wrote: >>[You don't need anything that fancy for strings to overlap. With null >>terminated readonly C-style strings, you can combine "storage" and >>"rage" and "age". Wih strings represented by a pointer and length, >>they can overlap anywhere. > > Yes. Tricks like that were used frequently in memory constrained > implementations. I wouldn't call it a "trick". It's a carefully-planned algorithm. > Pointer:length pairs permit multiple use of substrings, but don't > permit constructing a new string from arbitrary pieces of existing > ones. The tree representation can permit completely arbitrary > substring sharing. The overheads of that would be intolerable. The address-length pair is simple to use, can be passed easily as an argument (and returned easily from a function), and there is -- essentially -- no overhead until the dynamic string space gets used up, after which garbage collection is necessary. > Of course, given the small amount of memory available to early > implementations, tree representation of strings would have been > unworkable. Even with lots of memory, not really a proposition on account of overheads. With lots of memory, the garbage collection routine might not even be called. -- This email is free from viruses and malware that avast! Antivirus protection knows about, but is likely riddled with ones that it doesn't.