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

src: stop using v8::BackingStore::Reallocate #52292

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

targos
Copy link
Member

@targos targos commented Mar 31, 2024

It's being deprecated by V8.
Explicitly allocate a new ArrayBuffer and copy the data instead.

Fixes: #52234

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot 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. needs-ci PRs that need a full CI run. labels Mar 31, 2024
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

Some suggestions to avoid the copy when the size is the same.

(I do wonder now that we can't shrink the backing store in place, is there any benefit in allocating them on the V8 heap instead of using externally-managed buffers that we can realloc()? At least when we shrink externally-managed buffers we don't need to do the copy and it'll be cheaper. But that can be left as a TODO after we get rid of the deprecated API).

src/crypto/crypto_cipher.cc Outdated Show resolved Hide resolved
src/crypto/crypto_cipher.cc Outdated Show resolved Hide resolved
src/crypto/crypto_cipher.cc Outdated Show resolved Hide resolved
src/crypto/crypto_sig.cc Outdated Show resolved Hide resolved
src/node_http2.cc Outdated Show resolved Hide resolved
src/stream_base.cc Outdated Show resolved Hide resolved
src/udp_wrap.cc Outdated Show resolved Hide resolved
@targos
Copy link
Member Author

targos commented Mar 31, 2024

Updated!

@targos
Copy link
Member Author

targos commented Mar 31, 2024

Something's wrong with the new changes.

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]>
@targos targos added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 31, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 31, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos targos requested a review from joyeecheung April 1, 2024 08:41
@nodejs-github-bot
Copy link
Collaborator

@targos targos added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 5, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 5, 2024
@nodejs-github-bot nodejs-github-bot merged commit ec15504 into nodejs:main Apr 5, 2024
56 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in ec15504

@targos targos deleted the fix-52234 branch April 5, 2024 09:38
marco-ippolito pushed a commit that referenced this pull request 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 pull request 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
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. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please stop using v8::BackingStore::Reallocate
5 participants