Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tear down call for hxcpp? #6

Open
kevinresol opened this issue Feb 28, 2017 · 3 comments
Open

Tear down call for hxcpp? #6

kevinresol opened this issue Feb 28, 2017 · 3 comments

Comments

@kevinresol
Copy link

I would like to know corresponding tear-down calls for the following setup calls?

extern "C" void hxcpp_set_top_of_stack();
extern "C" const char *hxRunLibrary();
@kevinresol
Copy link
Author

Because I am trying to embed hxcpp code into an existing application. I would have to start the hxcpp part by calling hxRunLibrary and have to tear down properly so I can start again later. @hughsando any advice?

@kevinresol
Copy link
Author

ping @underscorediscovery @hughsando

@hughsando
Copy link

There is no really good way to tear-down everything. It is something I have been thinking about, but it is not trivial and would take some work.
For example - would you expect to reset the statics back to their initial values?

Two things you can do to reduce resources are to call
cpp.vm.gc.compact() to free as much memory as possible. You will need HXCPP_GC_MOVING defined to make the most of this.

Detach the main thread using:
hx::SetTopOfStack((int *)0,true);
Currently, you will need to use and external code method to call this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants