-
Notifications
You must be signed in to change notification settings - Fork 42
Implement setInterval functions & Fix timers memory bug
#311
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
Conversation
…` timers could be run When a `std::vector` gets expanded, reallocation happens, and the memory block is moved to somewhere else. We could no longer use a pointer to the handle after reallocation, but no problem if we use indices (i.e. the `timeoutId`).
…ss the job function succeeds or not
…tInterval` callback
f625c0b to
962ff2d
Compare
…mented `Timeout.refresh()` method
…require the event-loop
fix English Co-authored-by: philippedistributive <151072087+philippedistributive@users.noreply.github.com>
Co-authored-by: philippedistributive <151072087+philippedistributive@users.noreply.github.com>
…tivated again when a finished timer gets re-refed.
zollqir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from one missing decref
A new reference to `jobFn` is created in `enqueueWithDelay` by `PyCFunction_New`, so we are safe to decrease the reference count here. Co-authored-by: Caleb Aikens <caleb@distributive.network>
zollqir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;)
zollqir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Implement
setInterval/clearIntervalglobal functionsSee MDN and the spec
Fix a memory bug that limits the number of
setTimeout/setIntervaltimers could be runFix
pmjs -e/pmjs -pnot being able to call functions that require the event-loopCloses #266