JuliaLang/julia — pull request #1699 by simonster (2012-12-08 01:17:05+00:00)
Title: Implement signrank and wilcox functions in Rmath

The signrank and wilcox functions in Rmath allocate memory on the heap that needs to be freed with ```signrank_free`` and ```wilcox_free```. If we allocate and free with every call, the slowdown is an order of magnitude. Instead, this code attaches a finalizer to an empty array to free the memory when Julia performs GC. This seems a little kludgy, but it doesn't impair performance or leak memory. If there's a better way to handle this situation, I'm happy to learn.