-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add GC callbacks, and a mechanism to fix the threshold #407
base: master
Are you sure you want to change the base?
Conversation
In general, I'm supportive of the approach. I didn't comment on the style issues since they are not relevant just yet ;-) @chqrlie thoughts? |
Sadly style is about what you can expect by someone deeply unfamiliar with the codebase and who does not generally work with C :D. |
Ignore the style for now. It should just look like the surrounding code. We have no linter alas. |
Hello @KaruroChori, sorry for the lag, I am focused on some tricky issues ATM, I won't have much time to investigate your approach until next week. |
No problem! |
I fixed this PR to not duplicate #424 & reworked some of the naming. |
For context: saghul/txiki.js#516 & saghul/txiki.js#520
I implemented a draft of some new core features in quickjs to expose more of an interface for the GC to its runtime. This way it is easier for the application embedding quickjs to control when GC events can run and some related side effects.
This additional control is helpful in the context of systems with some real time requirements.
The extended interface basically consists of:
A getter for the cg threshold to complete its interface.added in a separate PRbefore
andafter
the CG event (not to be run for manually triggered ones).The
before
callback has a boolean return value to further specify if the event should be allowed to run or not.Tests are not provided yet since they might be a bit tricky to write, but if there is consensus on this or some alternative variant I will add some.