Skip to content

Commit

Permalink
Merge pull request #8562 from shirady/backport-into-5_17
Browse files Browse the repository at this point in the history
[Backport into 5.17] Removing `unique` and the unused `NAN_SET_BUF_DETACH`
  • Loading branch information
liranmauda authored Nov 28, 2024
2 parents 07bb564 + 3000867 commit ee50557
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
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

0 comments on commit ee50557

Please sign in to comment.