On Saturday, 6 February 2016 at 22:41:28 UTC, cy wrote:
On Saturday, 6 February 2016 at 10:29:32 UTC, Ola Fosheim
Grøstad wrote:
This prevents fast GC: Pointers.
Would it be possible to write a fast garbage collector that
just didn't track any pointers? Just offer a head's up that if
you use "this collector" and pointers on collectable data,
you're gonna have a bad time? How limited would you be if you
couldn't use pointers in your code? Do all D references count
as pointers, or is it only the T* types?
Yes, all references to gc allocated memory. "fast" is perhaps the
wrong word, Go has a concurrent collector with low latency
pauses, but requires slower code for mutating pointers since
another thread is collwcting garbage at the same time.
Things that could speed up collection:
- drop destructors so you don't track dead objects
- require pointers to beginning of gc object and make them a
special type, so you scan less
- use local heaps and local collection per fiber
- change layout so pointers end up on the same cachelines