More radical ideas about gc and reference counting

Michel Fortin via Digitalmars-d digitalmars-d at puremagic.com
Sun May 11 20:44:00 PDT 2014


On 2014-05-11 21:41:10 +0000, Walter Bright <newshound2 at digitalmars.com> said:

> Your proposal still relies on a GC to provide the memory safety, and 
> has no inherent protection against GC pauses. Your idea has a lot of 
> merit, but it is a hybrid ARC/GC system.

If you thread carefully you can disable GC collections at runtime and 
not suffer GC pauses. If you have no cycles and no gc_only pointers, 
then you won't run out of memory.

I think if this thread has proven something, it's that people need to 
be able to choose their memory management policy when the default is 
unsatisfactory. I'm trying to find a way to do that, a way to disable 
one side or the other if it is poisonous to your particular 
application. It is a hybrid system I'm suggesting, no doubt. It'd also 
be an interesting experiment, if someone wants to take it.


> As long as C++/CX and O-C are brought out here as proven, successful 
> examples for D to emulate here, and there is no acknowledgement that 
> they are not remotely memory safe, I need to continue to point this out.

You should not say that ARC is not safe then, you should say instead 
that ARC in those languages has to be supplemented with unsafe code to 
be fast enough. That statement I can agree with. Taking the shortcut 
saying simply "ARC is unsafe" is misleading.


-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list