Memory in JSI
In JS, the Garbage Collector (GC) handles memory. In C++, you have more control. When using JSI, you must understand how to manage objects so they don't cause memory leaks.
- Shared Pointers: Automatically track ownership.
- Weak Pointers: Avoid circular references.
- JS Values: How JSI keeps JS objects alive while C++ is using them.