On 31 October 2013 15:52, Ben Kloosterman <[email protected]> wrote:
> On Thu, Oct 31, 2013 at 10:56 AM, William ML Leslie
> <[email protected]> wrote:
>>
>> On 31 October 2013 12:26, Ben Kloosterman <[email protected]> wrote:
>> > Here you can map the data onto C but you have variable sized object
>> > header..
>> >
>> > Obj Header
>> > Field1
>> > Internal Header 1..
>> > Value type  1
>> > Internal Header 2..
>> > Value type  2
>> > Field 3
>> >
>> > Here you cant map the whole object onto a C object  ( or say a network
>> > packet header) as the C object doesnt have the header so you need fancy
>> > marshalling avoiding it is one of the main drivers for embedded nonboxed
>> > arrays .
>>
>> References to C value types are not garbage collected, at least, not
>> directly; so there is no problem here.
>>
>>
> I wasnt refering to interop how it relates to the GC but the fact that if
> you have a native structure you cant setup a strucure that matches it and
> then cast the header as a immutable typed reference.. .if you dont have a
> 1:1 representation. . You then have to copy everything to the GC and Marshal
> it - probably the major obstacle with C# in being used at more low level .
> Consider writing out a page table /LDT /GDT .  Even if you copy it, it is
> MUCH more eficient to have a 1:1 representation without headers
> interspersed.

I understood that.  I mean that in order for the representation to
really be 1:1, internal references to native values need /not/ to be
normal object references.  They need to be a distinct static type,
which does not copy when discovered by the GC, but does forward
references.

OR you need to avoid allocating plain C structs into a copying arena
that allows concurrent mutator and collector access.

That is, you can't alias an obref and a native pointer and have a
consistent GC scheme for the referrer.

-- 
William Leslie

Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law.  You absolutely may reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in.  Any attempt to deny you those rights would be illegal without
prior contractual agreement.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to