Safety, undefined behavior, @safe, @trusted

Walter Bright newshound1 at digitalmars.com
Thu Nov 5 16:17:55 PST 2009


Michel Fortin wrote:
> 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


Aaggghhhh !!! <g>

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



More information about the Digitalmars-d mailing list