GeezerVison is showing github.com — src: move internal functions out of node_buffer.h · nodejs/node@5586cec
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/node_buffer.h -22Lines changed: 0 additions & 22 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | #include "node.h" | 5 | 5 | #include "v8.h" | 6 | 6 |
| 7 | | -#if defined(NODE_WANT_INTERNALS) | 8 | | -#include "env.h" | 9 | | -#endif // defined(NODE_WANT_INTERNALS) | 10 | | - | 11 | 7 | namespace node { | 12 | 8 | namespace Buffer { | 13 | 9 |
| @@ -63,24 +59,6 @@ static inline bool IsWithinBounds(size_t off, size_t len, size_t max) { | 63 | 59 | return true; | 64 | 60 | } | 65 | 61 |
| 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 | | - | 84 | 62 | } // namespace Buffer | 85 | 63 | } // namespace node | 86 | 64 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/node_internals.h +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -272,6 +272,22 @@ class NodeInstanceData { | 272 | 272 | DISALLOW_COPY_AND_ASSIGN(NodeInstanceData); | 273 | 273 | }; | 274 | 274 |
| | 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 | + | 275 | 291 | } // namespace node | 276 | 292 |
| 277 | 293 | #endif // SRC_NODE_INTERNALS_H_ |
|