/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
benchmark/ffi/common.js
24 строки
926 B
Bryan English
ffi: add shared-buffer fast path for numeric and pointer signatures
28 апр 2026, 15:55
28 апр 2026, 15:55
1ad06ff
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const fs = require('node:fs'); const path = require('node:path'); // Cannot use test/ffi/ffi-test-common.js because it requires test/common // (the test harness module). Construct the path directly. const libraryPath = path.join(__dirname, '..', '..', 'test', 'ffi', 'fixture_library', 'build', common.buildType, process.platform === 'win32' ? 'ffi_test_library.dll' : process.platform === 'darwin' ? 'ffi_test_library.dylib' : 'ffi_test_library.so'); function ensureFixtureLibrary() { if (!fs.existsSync(libraryPath)) { throw new Error( `Missing FFI fixture library: ${libraryPath}. ` + 'Build it with `tools/test.py test/ffi/test-ffi-calls.js` first.', ); } } module.exports = { libraryPath, ensureFixtureLibrary };