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

core: refactor timers #492

Merged
merged 1 commit into from
Apr 17, 2024
Merged

core: refactor timers #492

merged 1 commit into from
Apr 17, 2024

Conversation

saghul
Copy link
Owner

@saghul saghul commented Apr 17, 2024

  • Don't use JS objects for timer handles
  • Use a hash table in C rather an a Map in JS
  • Allocate memory without using the JS allocator (1)
  1. This is important because the libuv loop outlives the JS runtime.
    Since handle closing is not sync and the callback where we need to
    free the structures will be called later it's not safe to use it.
    This is a small step in the direction of not using the JS allocator
    for structures that embed libuv handles.

@saghul saghul force-pushed the refactor-timers branch 3 times, most recently from 9aaa497 to 7b22e22 Compare April 17, 2024 22:35
- Don't use JS objects for timer handles
- Use a hash table in C rather an a Map in JS
- Allocate memory without using the JS allocator (1)

1) This is important because the libuv loop outlives the JS runtime.
   Since handle closing is not sync and the callback where we need to
   free the structures will be called later it's not safe to use it.
   This is a small step in the direction of not using the JS allocator
   for structures that embed libuv handles.
@saghul saghul marked this pull request as ready for review April 17, 2024 22:54
@saghul saghul merged commit 91d5821 into master Apr 17, 2024
14 checks passed
@saghul saghul deleted the refactor-timers branch April 17, 2024 22:57
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

Successfully merging this pull request may close these issues.

1 participant