koffi 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/cnoke.cjs +7 -7
- package/doc/benchmarks.md +1 -1
- package/doc/contribute.md +1 -1
- package/index.d.ts +356 -308
- package/package.json +16 -16
- package/src/koffi/CMakeLists.txt +1 -0
- package/src/koffi/index.cjs +30 -116
- package/src/koffi/index.js +27 -101
- package/src/koffi/indirect.cjs +29 -115
- package/src/koffi/indirect.js +28 -28
- package/src/koffi/src/abi/arm64.cc +1 -0
- package/src/koffi/src/abi/riscv64.cc +1 -0
- package/src/koffi/src/abi/x64sysv.cc +1 -0
- package/src/koffi/src/abi/x64win.cc +1 -0
- package/src/koffi/src/abi/x86.cc +1 -0
- package/src/koffi/src/call.cc +208 -97
- package/src/koffi/src/call.hh +2 -1
- package/src/koffi/src/ffi.cc +347 -237
- package/src/koffi/src/ffi.hh +37 -1
- package/src/koffi/src/parser.cc +3 -1
- package/src/koffi/src/static.cjs +122 -0
- package/src/koffi/src/static.js +122 -0
- package/src/koffi/src/type.cc +715 -0
- package/src/koffi/src/type.hh +71 -0
- package/src/koffi/src/util.cc +56 -1041
- package/src/koffi/src/util.hh +80 -119
- package/src/koffi/src/uv.cc +16 -10
- package/src/koffi/src/uv.hh +2 -1
- package/indirect.d.ts +0 -322
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
### Koffi 3.0
|
|
9
9
|
|
|
10
|
+
#### Koffi 3.0.2
|
|
11
|
+
|
|
12
|
+
*Released on 2026-05-26*
|
|
13
|
+
|
|
14
|
+
- Fix unexpected type error when passing array of pointers (see [Koromix/koffi#269](https://github.com/Koromix/koffi/issues/269))
|
|
15
|
+
- Search more native addons directories under process.resourcesPath
|
|
16
|
+
- Rearrange Koffi loading to use require() for static packages
|
|
17
|
+
- Fix error when using 'String' array hint with String32 type
|
|
18
|
+
- Add Buffer array hint to create Node Buffer objects
|
|
19
|
+
- Reduce overhead of various Koffi functions
|
|
20
|
+
|
|
10
21
|
#### Koffi 3.0.1
|
|
11
22
|
|
|
12
23
|
*Released on 2026-05-20*
|
package/cnoke.cjs
CHANGED
|
@@ -22,16 +22,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// src/cnoke/cnoke.js
|
|
26
26
|
var import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
27
27
|
|
|
28
|
-
//
|
|
28
|
+
// src/cnoke/src/builder.js
|
|
29
29
|
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
30
30
|
var import_node_os = __toESM(require("node:os"), 1);
|
|
31
31
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
32
32
|
var import_node_child_process = require("node:child_process");
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// src/cnoke/src/abi.js
|
|
35
35
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
36
|
function determineAbi() {
|
|
37
37
|
let abi = process.arch.toString();
|
|
@@ -121,7 +121,7 @@ function decodeElfHeader(buf) {
|
|
|
121
121
|
return header;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
//
|
|
124
|
+
// src/cnoke/src/util.js
|
|
125
125
|
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
126
126
|
function pathIsAbsolute(path2) {
|
|
127
127
|
if (process.platform == "win32" && path2.match(/^[a-zA-Z]:/))
|
|
@@ -194,7 +194,7 @@ function compareVersions(ver1, ver2) {
|
|
|
194
194
|
return cmp;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
//
|
|
197
|
+
// src/cnoke/src/assets.js
|
|
198
198
|
var FIND_CNOKE_CMAKE = `# SPDX-License-Identifier: MIT
|
|
199
199
|
# SPDX-FileCopyrightText: 2026 Niels Martign\xE8ne <niels.martignene@protonmail.com>
|
|
200
200
|
|
|
@@ -361,7 +361,7 @@ const PfnDliHook __pfnDliNotifyHook2 = self_exe_hook;
|
|
|
361
361
|
#endif
|
|
362
362
|
`;
|
|
363
363
|
|
|
364
|
-
//
|
|
364
|
+
// src/cnoke/src/builder.js
|
|
365
365
|
var DefaultOptions = {
|
|
366
366
|
mode: "RelWithDebInfo"
|
|
367
367
|
};
|
|
@@ -650,7 +650,7 @@ function Builder(config = {}) {
|
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
-
//
|
|
653
|
+
// src/cnoke/cnoke.js
|
|
654
654
|
var VALID_COMMANDS = ["build", "configure", "clean"];
|
|
655
655
|
main();
|
|
656
656
|
async function main() {
|
package/doc/benchmarks.md
CHANGED
|
@@ -7,7 +7,7 @@ This pages presents the execution time of Koffi calls on three benchmarks, where
|
|
|
7
7
|
|
|
8
8
|
# Linux x86_64
|
|
9
9
|
|
|
10
|
-
The results presented below were measured on my x86_64 Linux machine (
|
|
10
|
+
The results presented below were measured on my x86_64 Linux machine (AMD Ryzen™ 5 2600).
|
|
11
11
|
|
|
12
12
|
<div class="benchmark chart" data-platform="linux_x64"></div>
|
|
13
13
|
|