Yikes! It’s been longer than I thought it’s been since I last wrote on JsRT. Sorry about that, we’ve been a little busy.
With the two major concepts, runtimes and contexts, covered, there were a few additional things that need to be addressed for hosts that want to use JsRT. Probably the most important is how memory management is coordinated between Chakra and the host.
- The runtime’s garbage collected heap.
- The stack of the runtime’s current thread.
If a host is going to store a reference where the GC can’t see it, it will need to manually add a reference to the object itself by calling
JsAddRef. This will ensure the object will not go away until
JsRelease is called. Calls to
JsRelease have to be paired–unbalanced calls will result in objects being collected too soon or staying alive forever.
You should also follow me on Twitter here.