On 5/15/12, Jonathan M Davis <jmdavisp...@gmx.com> wrote:
> If you're going to use anything, use clear.

He might as well just use this if he wants the GC to take care of things:
arr = null;

clear(arr) is a little bit of a misnomer. If you have another slice
pointing to the same array clear() won't really release memory at all,
it will just make the first slice null. so using "arr = null" is good
enough.

Also good to note is that clear/null assign is very different from
what delete does. delete won't care that you have other slices
pointing to the same array and you'll end up with slices that point to
garbage after a call to delete.

Reply via email to