GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — worker: use engine-provided deleter for `SharedArrayBuffer`s by addaleax · Pull Request #25307 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Jan 1, 2019

Copy link
Copy Markdown
Member

Thanks to @devsnek for reporting this and coming up with a test case!


Store the full information we have on a given SharedArrayBuffer,
and use the deleter provided by the JS engine to free the memory
when that is needed.

This fixes memory lifetime management for WASM buffers that are
passed through a MessageChannel (e.g. between threads).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@addaleax
worker: use engine-provided deleter for SharedArrayBuffers
5bebab1
Store the full information we have on a given `SharedArrayBuffer`,
and use the deleter provided by the JS engine to free the memory
when that is needed.

This fixes memory lifetime management for WASM buffers that are
passed through a `MessageChannel` (e.g. between threads).
@nodejs-github-bot

nodejs-github-bot commented Jan 1, 2019

Copy link
Copy Markdown
Collaborator

@addaleax build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/2121/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 1, 2019
@addaleax addaleax added the worker Issues and PRs related to the worker_threads module and Worker API. label Jan 1, 2019
devsnek
devsnek approved these changes Jan 1, 2019
View reviewed changes
@devsnek devsnek added experimental Issues and PRs related to experimental features. wasm Issues and PRs related to WebAssembly. labels Jan 1, 2019
@addaleax

addaleax commented Jan 1, 2019

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/19906/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Jan 1, 2019
View reviewed changes
@addaleax

addaleax commented Jan 1, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Resume CI: https://ci.nodejs.org/job/node-test-pull-request/19907/ (:heavy_check_mark:)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 1, 2019
TimothyGu
TimothyGu approved these changes Jan 2, 2019
View reviewed changes
@addaleax
fixup! worker: use engine-provided deleter for SharedArrayBuffers
c6dbe1a
@addaleax

addaleax commented Jan 2, 2019

Copy link
Copy Markdown
Member Author

Fwiw, I’ve extended the test a bit. (@devsnek I’ve also figured out that we can’t transfer WebAssembly.Modules yet the way we should – also working on that.)

New CI: https://ci.nodejs.org/job/node-test-pull-request/19915/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax mentioned this pull request Jan 2, 2019
worker: enable transferring WASM modules #25314
Closed
3 tasks done
@addaleax
fixup! fixup! worker: use engine-provided deleter for `SharedArrayBuf…
c35ec27
…fer`s
@addaleax

addaleax commented Jan 3, 2019

Copy link
Copy Markdown
Member Author

Fixed the extended test on Windows.

New CI: https://ci.nodejs.org/job/node-test-pull-request/19918/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Jan 3, 2019

Copy link
Copy Markdown
Member Author

Landed in 1f1a373

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax closed this Jan 3, 2019
@addaleax
addaleax deleted the sab-deleter branch January 3, 2019 22:55
addaleax added a commit that referenced this pull request Jan 3, 2019
@addaleax
worker: use engine-provided deleter for SharedArrayBuffers
1f1a373
Store the full information we have on a given `SharedArrayBuffer`,
and use the deleter provided by the JS engine to free the memory
when that is needed.

This fixes memory lifetime management for WASM buffers that are
passed through a `MessageChannel` (e.g. between threads).

PR-URL: #25307
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
addaleax added a commit that referenced this pull request Jan 5, 2019
@addaleax
worker: use engine-provided deleter for SharedArrayBuffers
2014eba
Store the full information we have on a given `SharedArrayBuffer`,
and use the deleter provided by the JS engine to free the memory
when that is needed.

This fixes memory lifetime management for WASM buffers that are
passed through a `MessageChannel` (e.g. between threads).

PR-URL: #25307
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
@refack
worker: use engine-provided deleter for SharedArrayBuffers
5fd3b06
Store the full information we have on a given `SharedArrayBuffer`,
and use the deleter provided by the JS engine to free the memory
when that is needed.

This fixes memory lifetime management for WASM buffers that are
passed through a `MessageChannel` (e.g. between threads).

PR-URL: nodejs#25307
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
v11.7.0 proposal #25537
Merged
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
@addaleax @BridgeAR
worker: use engine-provided deleter for SharedArrayBuffers
418bff1
Store the full information we have on a given `SharedArrayBuffer`,
and use the deleter provided by the JS engine to free the memory
when that is needed.

This fixes memory lifetime management for WASM buffers that are
passed through a `MessageChannel` (e.g. between threads).

PR-URL: nodejs#25307
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
v11.8.0 proposal #25687
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
+2 more reviewers
@TimothyGu TimothyGu TimothyGu approved these changes
@devsnek devsnek devsnek approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. experimental Issues and PRs related to experimental features. wasm Issues and PRs related to WebAssembly. worker Issues and PRs related to the worker_threads module and Worker API.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@addaleax @nodejs-github-bot @jasnell @TimothyGu @devsnek
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.