File tree Expand file tree Collapse file tree 2 files changed +16
-22
lines changed Open diff view settings
Expand file tree Collapse file tree 2 files changed +16
-22
lines changed Open diff view settings
Original file line number Diff line number Diff line change 44#include " node.h"
55#include " v8.h"
66
7- #if defined(NODE_WANT_INTERNALS)
8- #include " env.h"
9- #endif // defined(NODE_WANT_INTERNALS)
10-
117namespace node {
128namespace Buffer {
139
@@ -63,24 +59,6 @@ static inline bool IsWithinBounds(size_t off, size_t len, size_t max) {
6359 return true ;
6460}
6561
66- // Internal. Not for public consumption. We can't define these
67- // in src/node_internals.h because of a circular dependency.
68- #if defined(NODE_WANT_INTERNALS)
69- v8::MaybeLocal<v8::Object> New (Environment* env, size_t size);
70- // Makes a copy of |data|.
71- v8::MaybeLocal<v8::Object> New (Environment* env, const char * data, size_t len);
72- // Takes ownership of |data|.
73- v8::MaybeLocal<v8::Object> New (Environment* env,
74- char * data,
75- size_t length,
76- FreeCallback callback,
77- void * hint);
78- // Takes ownership of |data|. Must allocate |data| with malloc() or realloc()
79- // because ArrayBufferAllocator::Free() deallocates it again with free().
80- // Mixing operator new and free() is undefined behavior so don't do that.
81- v8::MaybeLocal<v8::Object> Use (Environment* env, char * data, size_t length);
82- #endif // defined(NODE_WANT_INTERNALS)
83-
8462} // namespace Buffer
8563} // namespace node
8664
Original file line number Diff line number Diff line change @@ -272,6 +272,22 @@ class NodeInstanceData {
272272 DISALLOW_COPY_AND_ASSIGN (NodeInstanceData);
273273};
274274
275+ namespace Buffer {
276+ v8::MaybeLocal<v8::Object> New (Environment* env, size_t size);
277+ // Makes a copy of |data|.
278+ v8::MaybeLocal<v8::Object> New (Environment* env, const char * data, size_t len);
279+ // Takes ownership of |data|.
280+ v8::MaybeLocal<v8::Object> New (Environment* env,
281+ char * data,
282+ size_t length,
283+ void (*callback)(char * data, void * hint),
284+ void* hint);
285+ // Takes ownership of |data|. Must allocate |data| with malloc() or realloc()
286+ // because ArrayBufferAllocator::Free() deallocates it again with free().
287+ // Mixing operator new and free() is undefined behavior so don't do that.
288+ v8::MaybeLocal<v8::Object> Use (Environment* env, char * data, size_t length);
289+ } // namespace Buffer
290+
275291} // namespace node
276292
277293#endif // SRC_NODE_INTERNALS_H_
You can’t perform that action at this time.
0 commit comments