The cost of write barriers

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 3 04:12:13 PST 2014


On Monday, 3 November 2014 at 11:50:57 UTC, thedeemon wrote:
> On Sunday, 2 November 2014 at 10:36:13 UTC, Jonathan Barnard 
> wrote:
>> On Sunday, 2 November 2014 at 10:30:21 UTC, Araq wrote:
>>>
>>> And I think these are meaningless results. You can see here 
>>> for instance what a write barrier can look like:
>>>
>>> http://psy-lob-saw.blogspot.de/2014/10/the-jvm-write-barrier-card-marking.html
>
> Btw, how are write barriers implemented in Go now?

Some information on the upcoming release notes.

http://tip.golang.org/doc/go1.4#impl

>
>> Would such an implementation also be possible in a language 
>> like Go or D with internal/'thin' pointers?
>
> Yes, however the compiler needs to know all the places where 
> your code mutates pointers. That means you can't use memcpy to 
> copy some data with pointers into an old object or array. And 
> you can't mutate pointers from C code.

Now it is officially forbidden to just give a Go pointer directly 
to a C function.

It needs to be given as an uintptr, if I am not mistaken.


More information about the Digitalmars-d mailing list