What's the go with the GC these days?

Neia Neutuladh neia at ikeran.org
Mon Jan 7 21:57:18 UTC 2019


On Mon, 07 Jan 2019 13:06:22 -0800, H. S. Teoh wrote:
> Hmph, good point.  That sux. :-(  I suppose that's where copying/moving
> the object comes in -- migrate it to a different pool somehow so that we
> can avoid stop-the-world.

class Node
{
  enum Type { leaf, intermediate }
  Type type;
  union { Node child; ulong data; }
}
auto node = new Node;
node.type = Node.Type.leaf;
node.data = cast(ulong)cast(void*)node;

How do you copy this?

Pinning avoids those problems, but it still involves scanning memory as if 
doing a collection.


More information about the Digitalmars-d mailing list