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
diff options
context:
space:
mode:
authorKeyhan Vakil <kvakil@sylph.kvakil.me>2022-08-03 09:45:45 +0300
committerGitHub <noreply@github.com>2022-08-03 09:45:45 +0300
commit8c35a4e4e63d5c384b9ff5a4e9afdc903d242f72 (patch)
treedfda48b58f93ad161e66a3f77f054b2ecae341ad /src/util.h
parent4dedd81c1bd2ef1afb1183d515ca74b427349779 (diff)
src: remove unowned usages of GetBackingStore
This removes all usages of GetBackingStore without any entries in the `CODEOWNERS` file. For the most part this is a pretty straightforward review; except `SPREAD_BUFFER_ARG` and the changes to `CopyArrayBuffer`. See the linked issue for an explanation. Refs: https://github.com/nodejs/node/issues/32226 Refs: https://github.com/nodejs/node/pull/43921 PR-URL: https://github.com/nodejs/node/pull/44080 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/util.h b/src/util.h
index ea3ccb364bd..290862e21c1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -535,17 +535,14 @@ class BufferValue : public MaybeStackBuffer<char> {
inline std::string ToString() const { return std::string(out(), length()); }
};
-#define SPREAD_BUFFER_ARG(val, name) \
- CHECK((val)->IsArrayBufferView()); \
- v8::Local<v8::ArrayBufferView> name = (val).As<v8::ArrayBufferView>(); \
- std::shared_ptr<v8::BackingStore> name##_bs = \
- name->Buffer()->GetBackingStore(); \
- const size_t name##_offset = name->ByteOffset(); \
- const size_t name##_length = name->ByteLength(); \
- char* const name##_data = \
- static_cast<char*>(name##_bs->Data()) + name##_offset; \
- if (name##_length > 0) \
- CHECK_NE(name##_data, nullptr);
+#define SPREAD_BUFFER_ARG(val, name) \
+ CHECK((val)->IsArrayBufferView()); \
+ v8::Local<v8::ArrayBufferView> name = (val).As<v8::ArrayBufferView>(); \
+ const size_t name##_offset = name->ByteOffset(); \
+ const size_t name##_length = name->ByteLength(); \
+ char* const name##_data = \
+ static_cast<char*>(name->Buffer()->Data()) + name##_offset; \
+ if (name##_length > 0) CHECK_NE(name##_data, nullptr);
// Use this when a variable or parameter is unused in order to explicitly
// silence a compiler warning about that.