4 ms·
And if I use only a bit of the GC, can I use only a bit of write barriers? Walter Bright was right about segmented stacks, I'm tempted to think he's right abou
by p0nce 10y ago
And if I use only a bit of the GC, can I use only a bit of write barriers?
Walter Bright was right about segmented stacks, I'm tempted to think he's right about write barriers too.
- pcwalton 10y agoIf the compiler can statically tell which pointers point to GC memory (something it usually needs to know anyway), yes.
- p0nce 10y agoIn D this is indeed known only at runtime, one of the decision was that "there should be only one type of pointers". immutable(T) doesn't guarantee it isn't in the GC heap from what I can gather. shared(T) could perhaps do it, but it's rather unpopular.
- pcwalton 10y agoIf you really don't know until runtime what heap a pointer is in, then write barriers will have some kind of cost, but it should be low (definitely not atomic). However, if you don't know statically what kind of heap a pointer is in, you're going to have a poorly performing GC system no matter what.