Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport into 5.17] Removing unique and the unused NAN_SET_BUF_DETACH #8562

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/native/util/buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ class Buf
return _alloc->detach();
}

inline bool
unique_alloc()
{
return _alloc.unique();
}

inline bool
same(const Buf& buf) const
{
Expand Down
6 changes: 0 additions & 6 deletions src/native/util/nan.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ NanKey(std::string s)
#define NAN_SET_NUM(obj, key, val) (NAN_SET(obj, key, Nan::New<v8::Number>(val)))
#define NAN_SET_BUF_COPY(obj, key, buf) \
(NAN_SET(obj, key, Nan::CopyBuffer(buf.cdata(), buf.length()).ToLocalChecked()))
#define NAN_SET_BUF_DETACH(obj, key, buf) \
do { \
assert(buf.unique_alloc()); \
NAN_SET(obj, key, Nan::NewBuffer(buf.cdata(), buf.length()).ToLocalChecked()); \
buf.detach_alloc(); \
} while (0)

#define NAN_ERR(msg) (Nan::To<v8::Object>(Nan::Error(msg)).ToLocalChecked())
#define NAN_RETURN(val) \
Expand Down