electron/patches/node/override_existing_v8_reallocate.patch
Electron Bot 39baf68790
chore: bump chromium to 5b340c815ce15ab2efcf277ed19e9 (master) (#22064)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: loc <andy@slack-corp.com>
Co-authored-by: Robo <hop2deep@gmail.com>
Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
2020-03-03 13:35:05 -08:00

23 lines
1.1 KiB
Diff

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
makes its way into Node.js
diff --git a/src/node_internals.h b/src/node_internals.h
index b94f31f86ba1597a9d87e5beb70fccc4fe3a7aae..fb155265bdc31fd443065d33c0b4d7d5f373a643 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));
}