FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: refactor weakref cleanup by devsnek · Pull Request #30198 · nodejs/node · GitHub

/ node Public

src: refactor weakref cleanup - #30198

Closed
devsnek wants to merge 1 commit into
nodejs:masterfrom
devsnek:refactor-weak-refs
Closed

src: refactor weakref cleanup#30198
devsnek wants to merge 1 commit into
nodejs:masterfrom
devsnek:refactor-weak-refs

Conversation

devsnek commented Oct 31, 2019

Copy link
Copy Markdown
Member
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Oct 31, 2019
devsnek force-pushed the refactor-weak-refs branch from 7aa2a72 to 1aff25f Compare October 31, 2019 17:31

addaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you explain the motivation here? I feel like this is a step in an odd direction, and I'd still prefer to run these as tasks on an uv_async_t rather than doing so using the miceotask queue or running at the end of the callback scope...

Comment thread src/api/environment.cc

void HostCleanupFinalizationGroupMicrotask(void* data) {
FinalizationGroupCleanupTask* t =
reinterpret_cast<FinalizationGroupCleanupTask*>(data);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you use static_cast here?

Comment thread src/api/environment.cc
env->RegisterFinalizationGroupForCleanup(group);
env->isolate()->EnqueueMicrotask(
HostCleanupFinalizationGroupMicrotask,
new FinalizationGroupCleanupTask(env, group));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this misses a corresponding delete?

devsnek commented Oct 31, 2019

Copy link
Copy Markdown
Member Author

@addaleax ClearKeptObjects is in the correct place either way. Why would a uv_async_t be preferable for the finalization cleanup?

Copy link
Copy Markdown
Member

@devsnek I still think it’s preferable to run these callbacks after GC without an unbounded delay, like whatwg/html#4571 suggests it for HTML.

Copy link
Copy Markdown
Member

Hm … ping @devsnek? I’m currently running into the “Cannot create a handle without a HandleScope” crash :)

addaleax added a commit to addaleax/node that referenced this pull request Nov 23, 2019
Schedule a task on the main event loop, similar to what the HTML
spec recommends for browsers.

Alternative to nodejs#30198
addaleax mentioned this pull request Nov 23, 2019
4 tasks
devsnek closed this Nov 23, 2019
devsnek deleted the refactor-weak-refs branch November 23, 2019 23:43
addaleax added a commit that referenced this pull request Nov 29, 2019
Schedule a task on the main event loop, similar to what the HTML
spec recommends for browsers.

Alternative to #30198

PR-URL: #30616
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
addaleax added a commit that referenced this pull request Nov 29, 2019
Schedule a task on the main event loop, similar to what the HTML
spec recommends for browsers.

Alternative to #30198

PR-URL: #30616
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos pushed a commit that referenced this pull request Jan 13, 2020
Schedule a task on the main event loop, similar to what the HTML
spec recommends for browsers.

Alternative to #30198

PR-URL: #30616
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
Schedule a task on the main event loop, similar to what the HTML
spec recommends for browsers.

Alternative to #30198

PR-URL: #30616
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL