MCPcopy Create free account
hub / github.com/nodejs/nan / NAN_METHOD

Function NAN_METHOD

test/cpp/buffer.cpp:21–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21NAN_METHOD(New1) {
22 char *dynamic_data = static_cast<char *>(malloc(DATA_SIZE));
23 for (unsigned char i = 0; i < DATA_SIZE; i++) {
24 dynamic_data[i] = 'a' + i;
25 }
26 info.GetReturnValue().Set(
27 NewBuffer(dynamic_data, DATA_SIZE, callback, 0).ToLocalChecked());
28}
29
30NAN_METHOD(New2) {
31 v8::Local<v8::Object> buf = NewBuffer(DATA_SIZE).ToLocalChecked();

Callers

nothing calls this directly

Calls 6

NewBufferFunction · 0.85
CopyBufferFunction · 0.85
ToLocalCheckedMethod · 0.80
DataFunction · 0.50
SetMethod · 0.45
GetReturnValueMethod · 0.45

Tested by

no test coverage detected