Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't understand this. Isn't sorting an in-place procedure that does not need to allocate on the heap?


Depends on the sort. A naively implemented mergesort needs a temporary array of the same size as the the array being sorted. But whilst that takes up a chunk of memory for a while, it shouldn't be the sort of thing that makes GC choke.

And anyway, not many people will be using a naively implemented mergesort in this situation!


Sure, as long as you're okay with mutable data structures and the headaches they cause with threading.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: