Re: Best Ref-counting algorithms?

"BartC" <bartc@freeuk.com>
Thu, 16 Jul 2009 09:54:56 GMT

          From comp.compilers

Related articles
[13 earlier articles]
Re: Best Ref-counting algorithms? cr88192@hotmail.com (BGB / cr88192) (2009-07-15)
Re: Best Ref-counting algorithms? cr88192@hotmail.com (BGB / cr88192) (2009-07-15)
Re: Best Ref-counting algorithms? cr88192@hotmail.com (BGB / cr88192) (2009-07-15)
Re: Best Ref-counting algorithms? cr88192@hotmail.com (BGB / cr88192) (2009-07-15)
Re: Best Ref-counting algorithms? gene.ressler@gmail.com (Gene) (2009-07-15)
Re: Best Ref-counting algorithms? torbenm@pc-003.diku.dk (2009-07-16)
Re: Best Ref-counting algorithms? bartc@freeuk.com (BartC) (2009-07-16)
Re: Best Ref-counting algorithms? gneuner2@comcast.net (George Neuner) (2009-07-16)
Re: Best Ref-counting algorithms? haberg_20080406@math.su.se (Hans Aberg) (2009-07-17)
Re: Best Ref-counting algorithms? haberg_20080406@math.su.se (Hans Aberg) (2009-07-17)
Re: Best Ref-counting algorithms? cppljevans@gmail.com (Larry) (2009-07-17)
Re: Best Ref-counting algorithms? lerno@dragonascendant.com (=?ISO-8859-1?Q?Christoffer_Lern=F6?=) (2009-07-17)
Re: Best Ref-counting algorithms? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-07-17)
[14 later articles]
| List of all articles for this month |

From: "BartC" <bartc@freeuk.com>
Newsgroups: comp.compilers
Date: Thu, 16 Jul 2009 09:54:56 GMT
Organization: Compilers Central
References: 09-07-018 09-07-039 09-07-048
Keywords: GC
Posted-Date: 16 Jul 2009 18:34:35 EDT

"BGB / cr88192" <cr88192@hotmail.com> wrote in message
> "George Neuner" <gneuner2@comcast.net> wrote in message
>> On Sun, 12 Jul 2009 13:41:59 -0700 (PDT), Christoffer Lernv




>> If you're dead set on reference counting, you should investigate 1-bit
>> reference counting. I don't have URL's to give you but they should be
>> easy to find. The programming language is designed so that most data
>> are not shared and then you only need a simple flag to say whether the
>> item is shared and so needs special handling.
>>
>
> this sounds interesting, but I don't know much about this approach...


It sounds scarily like what I was once using: a language where
variables never shared data, except when used in expressions and
function calls, when a copy bit was set so that only shallow copies of
any value could be pushed around instead.


With strings, and arrays of arbitrary complexity, being handled
automatically with implicit pointers and the copy bit used to tell it
when to free, duplicate, or do nothing, this worked extremely well
with no need for GC:


a:=(10,20,30,40,50) >reate some array
a:=0 #now the array magically disappears and a is an int


It doesn't work well however when the language allows *explicit* pointers:


a:=(10,20,30,40,50) #an array again
p:=&a[2] #set some explicit pointers to elements in a
q:=&a[3]
a:=0


Now the array disappears again, but p and q are left pointing at phantom
elements. If this 1-bit trick can help with this, I'd be interested too, as
full GC seems an overkill. At this moment it's not too much of a problem,
because explicit pointers aren't used so much, and when they are they are
just managed manually.


--
Bart



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.