Support reset & dispose
Thanks for your new PR, Noticed that dispose method was added. Could you please clarify the indentation? I see that it's being checked in every method, and I'm trying to understand its necessity.
Also, I noticed that the underlying implementation of the dispose method is actually calling index_.release();. If we keep this method, would it be more appropriate to rename it to release to reflect its actual functionality?
Thanks for your new PR, Noticed that
disposemethod was added. Could you please clarify the indentation? I see that it's being checked in every method, and I'm trying to understand its necessity.Also, I noticed that the underlying implementation of the
disposemethod is actually callingindex_.release();. If we keep this method, would it be more appropriate to rename it toreleaseto reflect its actual functionality?
Dispose is used to free all memory associated with an index. If you're OK with a segfault if calling a method on a released index, then I'm fine reverting the checks from every method.
dispose is consistent naming across ML frameworks for freeing memory. But up to you if you want to change it.
@asilvas In the world of javascript, memory is rarely dealt with, the reset and dispose have similar uses. I want to remove the dispose method first, and merge this pr. Is this okay?
@asilvas In the world of javascript, memory is rarely dealt with, the
resetanddisposehave similar uses. I want to remove thedisposemethod first, and merge this pr. Is this okay?
I'd prefer to keep both as there is no other way to free all memory, and have need for recreating a lot of indexes.