Skip to content

Commit

Permalink
Fixup V8 Reallocate patch
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and John Kleinschmidt committed Jun 8, 2020
1 parent 41f1e1f commit 92bbc1b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions patches/node/override_existing_v8_reallocate.patch
Expand Up @@ -6,18 +6,18 @@ Subject: Override existing V8 Reallocate
Refs https://chromium-review.googlesource.com/c/v8/v8/+/2007274.
Reallocate has been implemented by V8 itself, so this function must now
be overridden. This patch can be removed once the relevant version of V8
makes its way into Node.js
makes its way into Node.js.

diff --git a/src/node_internals.h b/src/node_internals.h
index 0279a4a8274f408049aae5464a7f4559ebe48110..e5d5a6497de3386c7aa70efc1f202f79d9f7567f 100644
index b627ad3ef42835407a83b721a2f78d4128e48327..efea9db2da008be6a1a470cece9d7a04a628c1a8 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -115,7 +115,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
void* AllocateUninitialized(size_t size) override
{ return node::UncheckedMalloc(size); }
void Free(void* data, size_t) override { free(data); }
- virtual void* Reallocate(void* data, size_t old_size, size_t size) {
+ virtual void* Reallocate(void* data, size_t old_size, size_t size) override {
return static_cast<void*>(
UncheckedRealloc<char>(static_cast<char*>(data), size));
void* Allocate(size_t size) override; // Defined in src/node.cc
void* AllocateUninitialized(size_t size) override;
void Free(void* data, size_t size) override;
- virtual void* Reallocate(void* data, size_t old_size, size_t size);
+ virtual void* Reallocate(void* data, size_t old_size, size_t size) override;
virtual void RegisterPointer(void* data, size_t size) {
total_mem_usage_.fetch_add(size, std::memory_order_relaxed);
}

0 comments on commit 92bbc1b

Please sign in to comment.