2020-02-03 22:39:41 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shelley Vohr <shelley.vohr@gmail.com>
|
|
|
|
Date: Mon, 3 Feb 2020 10:06:45 -0800
|
|
|
|
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
|
2020-06-17 22:57:12 +00:00
|
|
|
makes its way into Node.js.
|
2020-02-03 22:39:41 +00:00
|
|
|
|
|
|
|
diff --git a/src/node_internals.h b/src/node_internals.h
|
2020-06-19 00:37:23 +00:00
|
|
|
index cb388f3a9f12949fd3ecb0406f7b550f4ca5ca7c..f4b5c9bb7058da2355204a7285e5f7cc70c4ffda 100644
|
2020-02-03 22:39:41 +00:00
|
|
|
--- a/src/node_internals.h
|
|
|
|
+++ b/src/node_internals.h
|
|
|
|
@@ -115,7 +115,7 @@ class NodeArrayBufferAllocator : public ArrayBufferAllocator {
|
2020-06-17 22:57:12 +00:00
|
|
|
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);
|
2020-02-03 22:39:41 +00:00
|
|
|
}
|