MCPcopy Index your code
hub / github.com/nodejs/node / wrapFFIFunction

Function wrapFFIFunction

lib/ffi.js:82–98  ·  view source on GitHub ↗
(rawFn, argumentTypes, returnType, owner)

Source from the content-addressed store, hash-verified

80}
81
82function wrapFFIFunction(rawFn, argumentTypes, returnType, owner) {
83 if (argumentTypes === undefined && rawFn !== undefined && rawFn !== null) {
84 const sbArguments = rawFn[kSbArguments];
85 argumentTypes = sbArguments ?? rawFn[kFastArguments];
86 if (sbArguments !== undefined) {
87 returnType = rawFn[kSbReturn];
88 }
89 }
90 initializeFastBufferMetadata(rawFn, argumentTypes);
91 const wrapped = wrapWithSharedBuffer(
92 rawFn,
93 argumentTypes === undefined ? undefined : makeSignature(argumentTypes, returnType));
94 if (wrapped !== rawFn) {
95 return wrapped;
96 }
97 return wrapWithRawPointerConversions(rawFn, argumentTypes, owner);
98}
99
100const rawGetFunction = DynamicLibrary.prototype.getFunction;
101const rawGetFunctions = DynamicLibrary.prototype.getFunctions;

Callers 2

ffi.jsFile · 0.85
getFunction · 0.85

Calls 4

wrapWithSharedBufferFunction · 0.85
makeSignatureFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…