I'm just playing with this a little more and the bgi thing that seems to be bugging me is TLS doesn't work here. D assumes it, so if you use a tls var (as opposed to __gshared or local) you get annoying segfaults. Blargh.