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

Please stop using v8::BackingStore::Reallocate #52234

Closed
syg opened this issue Mar 27, 2024 · 2 comments · Fixed by #52292
Closed

Please stop using v8::BackingStore::Reallocate #52234

syg opened this issue Mar 27, 2024 · 2 comments · Fixed by #52292
Labels
deprecations Issues and PRs related to deprecations. v8 platform Issues and PRs related to Node's v8::Platform implementation.

Comments

@syg
Copy link
Contributor

syg commented Mar 27, 2024

V8 is deprecating and removing v8::BackingStore::Reallocate for being a safety footgun: https://issues.chromium.org/u/1/issues/331326406

Node uses it currently AFAICT for some internal buffers. Note that since #43594, there is no performance benefit of using Reallocate. Node's override of Reallocate defers to the default implementation, which allocates a new block of memory and performs a copy. It would be better to explicitly allocate a new v8::BackingStore and explicitly memcpy for the current uses of Reallocate.

(If I have some time I'll try to make a PR. But if someone is inclined to change this, please do so!)

@kylo5aby
Copy link
Contributor

I would like to make a PR

@marco-ippolito marco-ippolito added deprecations Issues and PRs related to deprecations. v8 platform Issues and PRs related to Node's v8::Platform implementation. labels Mar 28, 2024
@joyeecheung
Copy link
Member

joyeecheung commented Mar 28, 2024

Since the override was removed to be compatible with V8 sandboxed pointers for Electron, cc @nornagon @codebytere

targos added a commit to targos/node that referenced this issue Mar 31, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs#52234
targos added a commit that referenced this issue Mar 31, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: #52234
targos added a commit to targos/node that referenced this issue Mar 31, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data when needed
instead.

Fixes: nodejs#52234
Co-authored-by: Joyee Cheung <[email protected]>
nodejs-github-bot pushed a commit to nodejs/node-v8 that referenced this issue Mar 31, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs/node#52234
targos added a commit to targos/node that referenced this issue Mar 31, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data when needed
instead.

Fixes: nodejs#52234
Co-authored-by: Joyee Cheung <[email protected]>
nodejs-github-bot pushed a commit to nodejs/node-v8 that referenced this issue Apr 1, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs/node#52234
nodejs-github-bot pushed a commit to nodejs/node-v8 that referenced this issue Apr 2, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs/node#52234
targos added a commit that referenced this issue Apr 3, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: #52234
nodejs-github-bot pushed a commit to nodejs/node-v8 that referenced this issue Apr 3, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs/node#52234
nodejs-github-bot pushed a commit to nodejs/node-v8 that referenced this issue Apr 4, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs/node#52234
nodejs-github-bot pushed a commit to nodejs/node-v8 that referenced this issue Apr 5, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: nodejs/node#52234
nodejs-github-bot pushed a commit that referenced this issue Apr 5, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data when needed
instead.

Fixes: #52234
Co-authored-by: Joyee Cheung <[email protected]>
PR-URL: #52292
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
marco-ippolito pushed a commit that referenced this issue May 2, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data when needed
instead.

Fixes: #52234
Co-authored-by: Joyee Cheung <[email protected]>
PR-URL: #52292
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
marco-ippolito pushed a commit that referenced this issue May 3, 2024
It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data when needed
instead.

Fixes: #52234
Co-authored-by: Joyee Cheung <[email protected]>
PR-URL: #52292
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecations Issues and PRs related to deprecations. v8 platform Issues and PRs related to Node's v8::Platform implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants