A bidirectional mapping of a pyobject and the d object associated to it.
On the python side, these are weak references; we don't want to prevent
python from reclaiming objects it is finished with. As such, on the D side,
if you take PyObject*s out of here and store them for an extended time
elsewhere, be sure to increment the reference count.
On the D side, we have strong references, but that is incidental to the GC.
If you stick d objects not allocated with the GC, there will probably be
leaks.
We use malloc for the container's structure because we can't use the GC
inside a destructor and we need to use this container there.
A bidirectional mapping of a pyobject and the d object associated to it. On the python side, these are weak references; we don't want to prevent python from reclaiming objects it is finished with. As such, on the D side, if you take PyObject*s out of here and store them for an extended time elsewhere, be sure to increment the reference count. On the D side, we have strong references, but that is incidental to the GC. If you stick d objects not allocated with the GC, there will probably be leaks. We use malloc for the container's structure because we can't use the GC inside a destructor and we need to use this container there.