Safety, undefined behavior, @safe, @trusted

Michel Fortin michel.fortin at michelf.com
Thu Nov 5 15:02:48 PST 2009


On 2009-11-05 17:11:38 -0500, Walter Bright <newshound1 at digitalmars.com> said:

> dsimcha wrote:
>> Ok, I understand the basic principle of a reap, but if it's going to 
>> convert to a
>> heap when you try to delete something, why not just improve the 
>> standard GC heap,
>> i.e. by making per-thread heaps?
> 
> The problem with per-thread heaps is immutable data can be passed 
> between threads.

Well, if that's a problem you could fix it by making immutable not 
shared unless you also put the shared attribute:

	immutable Object o;        // thread-local
	shared immutable Object o; // visible from all threads

I think having per-thread heaps is a worthy goal.

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




More information about the Digitalmars-d mailing list