Allocate precomputation arrays on the heap

Doing them entirely on the stack seems to upset Windows (or at least Wine).

Also, delete an unused function.