GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: move internal functions out of node_buffer.h · nodejs/node@5586cec

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_buffer.h
    • node_internals.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_buffer.h‎

Copy file name to clipboardExpand all lines: src/node_buffer.h
-22Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
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-
117
namespace node {
128
namespace 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

Collapse file

‎src/node_internals.h‎

Copy file name to clipboardExpand all lines: src/node_internals.h
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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_

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.