Skip to content

core: refactor timers#492

Merged
saghul merged 1 commit intomasterfrom
refactor-timers
Apr 17, 2024
Merged

core: refactor timers#492
saghul merged 1 commit intomasterfrom
refactor-timers

Conversation

@saghul
Copy link
Copy Markdown
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
@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