recast-navigation-js icon indicating copy to clipboard operation
recast-navigation-js copied to clipboard

Improve memory cleanup functionality and document

Open isaac-mason opened this issue 1 year ago • 3 comments

Right now manual memory management with this lib is not straightforward, and not everything required is correctly exposed. Also, nothing is documented in the READMEs

This needs fixing!

todo:

  • add destroy() methods where appropriate
  • expose emscripten _free and destroy in @recast-navigation/core for more advanced use cases
  • add memory management information to READMEs

isaac-mason avatar May 08 '23 13:05 isaac-mason

Progressed by: https://github.com/isaac-mason/recast-navigation-js/commit/273c456051a6a4ad7f0deb13d7c391842c552d47

Still requires documenting

isaac-mason avatar Jun 19 '23 10:06 isaac-mason

Right now recast-navigation has some functionality for attempting to automatically free memory when c++ objects aren't correctly destroyed via FinalizationRegistry.

I'm not 100% convinced the feature is a good idea, and the current implementation isn't great. It should be removed at least for now.

isaac-mason avatar Sep 26 '23 13:09 isaac-mason

https://github.com/isaac-mason/recast-navigation-js/commit/257e98842487b586428f3f0af5d97ac0cd17040c

isaac-mason avatar Sep 26 '23 13:09 isaac-mason