Componentizing D's garbage collector

Timon Gehr timon.gehr at gmx.ch
Tue Jan 14 06:22:26 PST 2014


On 01/14/2014 10:11 AM, Paulo Pinto wrote:
> On Monday, 13 January 2014 at 23:42:50 UTC, Timon Gehr wrote:
>> On 01/13/2014 11:05 PM, Paulo Pinto wrote:
>>> Am 13.01.2014 22:31, schrieb Timon Gehr:
>>>> On 01/13/2014 10:11 PM, Walter Bright wrote:
>>>>>>
>>>>>> Not to say there aren't other ways of doing things, but with random
>>>>>> objects
>>>>>> becoming pinnable puts a big damper on things unless you can identify
>>>>>> all the
>>>>>> objects that might be pinned and isolate them.  But I doubt that's
>>>>>> really
>>>>>> knowable up front.
>>>>>
>>>>> The reason pinning doesn't particularly impede this is because pinning
>>>>> is rare.
>>>>
>>>> In Java or in D? Eg. there are no unions in Java.
>>>
>>> C# has unions.
>>>
>>> http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute%28v=vs.110%29.aspx
>>>
>>>
>>
>> "The common language runtime controls the physical layout of the data
>> fields of a class or structure in managed memory. However, ..."
>
>
> Did you also read the remaining part of the page,

Obviously.

> or just looked for something to paste?
> ...

Look, you hadn't done anything besides pasting for backing up your point 
or making it precise. I'll be proven wrong if you are able to show us 
how you do the following in C#:

union U{
     int x;
     Object y;
}

> You can control the layout, that is what matters.  Not at what level you
> are expressing it.
> ...

Obviously.

> Ignoring what such runtimes offer, only puts D at disadvantage when
> comparing feature lists, which many in the industry do.
>...

Every resource I have encountered indicates that C# does not offer this 
functionality because it is detrimental to GC, eg:

http://stackoverflow.com/questions/17771902/struct-memory-hack-to-overlap-object-reference-is-it-possible


More information about the Digitalmars-d mailing list