Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarshan Sen <raisinten@gmail.com>2021-02-19 18:09:01 +0300
committerMichaƫl Zasso <targos@protonmail.com>2021-02-28 16:40:16 +0300
commitf1381f7a7a69a196a78db28e8b1389f5e0deb811 (patch)
tree20572b11c8119b6ce2980b197b85fa06be14b76b /src
parentb38404ee171526f44467007cec9c31d627b62815 (diff)
src: fix alloc-dealloc-mismatch in node_snapshotable.h
Fixes: https://github.com/nodejs/node/issues/37442 PR-URL: https://github.com/nodejs/node/pull/37443 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_snapshotable.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_snapshotable.h b/src/node_snapshotable.h
index 3a0d3e42f4c..04277ff5378 100644
--- a/src/node_snapshotable.h
+++ b/src/node_snapshotable.h
@@ -48,7 +48,7 @@ struct InternalFieldInfo {
static InternalFieldInfo* New(EmbedderObjectType type, size_t length) {
InternalFieldInfo* result =
- reinterpret_cast<InternalFieldInfo*>(::operator new(length));
+ reinterpret_cast<InternalFieldInfo*>(::operator new[](length));
result->type = type;
result->length = length;
return result;
@@ -56,12 +56,12 @@ struct InternalFieldInfo {
InternalFieldInfo* Copy() const {
InternalFieldInfo* result =
- reinterpret_cast<InternalFieldInfo*>(::operator new(length));
+ reinterpret_cast<InternalFieldInfo*>(::operator new[](length));
memcpy(result, this, length);
return result;
}
- void Delete() { ::operator delete(this); }
+ void Delete() { ::operator delete[](this); }
};
// An interface for snapshotable native objects to inherit from.