-
-
Notifications
You must be signed in to change notification settings - Fork 37k
Please stop using v8::BackingStore::Reallocate #52234
Copy link
Copy link
Closed
Labels
deprecationsIssues and PRs related to deprecations.Issues and PRs related to deprecations.v8 platformIssues and PRs related to the Node.js implementation of v8::Platform.Issues and PRs related to the Node.js implementation of v8::Platform.
Description
Activity
Metadata
Metadata
Assignees
Labels
deprecationsIssues and PRs related to deprecations.Issues and PRs related to deprecations.v8 platformIssues and PRs related to the Node.js implementation of v8::Platform.Issues and PRs related to the Node.js implementation of v8::Platform.
V8 is deprecating and removing
v8::BackingStore::Reallocatefor being a safety footgun: https://issues.chromium.org/u/1/issues/331326406Node uses it currently AFAICT for some internal buffers. Note that since #43594, there is no performance benefit of using
Reallocate. Node's override ofReallocatedefers to the default implementation, which allocates a new block of memory and performs a copy. It would be better to explicitly allocate a newv8::BackingStoreand explicitly memcpy for the current uses ofReallocate.(If I have some time I'll try to make a PR. But if someone is inclined to change this, please do so!)