koffi 2.16.1 → 3.0.0-alpha.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 +2 -2
- package/README.md +8 -8
- package/build/koffi/darwin_arm64/koffi.node +0 -0
- package/build/koffi/darwin_x64/koffi.node +0 -0
- package/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/build/koffi/freebsd_x64/koffi.node +0 -0
- package/build/koffi/linux_arm64/koffi.node +0 -0
- package/build/koffi/linux_ia32/koffi.node +0 -0
- package/build/koffi/linux_x64/koffi.node +0 -0
- package/build/koffi/musl_arm64/koffi.node +0 -0
- package/build/koffi/musl_x64/koffi.node +0 -0
- package/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/build/koffi/openbsd_x64/koffi.node +0 -0
- package/build/koffi/win32_ia32/koffi.node +0 -0
- package/build/koffi/win32_x64/koffi.node +0 -0
- package/doc/benchmarks.md +33 -33
- package/doc/benchmarks.xlsx +0 -0
- package/doc/contribute.md +37 -25
- package/doc/index.md +8 -8
- package/doc/variables.md +1 -1
- package/index.d.ts +11 -9
- package/index.js +1 -634
- package/indirect.js +1 -533
- package/lib/native/base/base.cc +63 -85
- package/lib/native/base/base.hh +178 -151
- package/package.json +3 -4
- package/src/build.js +1178 -0
- package/src/koffi/CMakeLists.txt +97 -34
- package/src/koffi/index.js +359 -0
- package/src/koffi/indirect.js +216 -0
- package/src/koffi/src/{abi_arm32.cc → abi/arm32.cc} +279 -275
- package/src/koffi/src/{abi_arm32_asm.S → abi/arm32_asm.S} +2 -5
- package/src/koffi/src/abi/arm64.cc +1511 -0
- package/src/koffi/src/{abi_arm64_asm.S → abi/arm64_asm.S} +44 -23
- package/src/koffi/src/{abi_arm64_asm.asm → abi/arm64_asm.asm} +32 -25
- package/src/koffi/src/{abi_loong64_asm.S → abi/loong64_asm.S} +1 -5
- package/src/koffi/src/{abi_riscv64.cc → abi/riscv64.cc} +279 -273
- package/src/koffi/src/{abi_riscv64_asm.S → abi/riscv64_asm.S} +1 -4
- package/src/koffi/src/abi/x64sysv.cc +1456 -0
- package/src/koffi/src/{abi_x64_sysv_asm.S → abi/x64sysv_asm.S} +30 -33
- package/src/koffi/src/abi/x64win.cc +1121 -0
- package/src/koffi/src/{abi_x64_win_asm.S → abi/x64win_asm.S} +8 -12
- package/src/koffi/src/{abi_x64_win_asm.asm → abi/x64win_asm.asm} +11 -14
- package/src/koffi/src/abi/x86.cc +1233 -0
- package/src/koffi/src/{abi_x86_asm.S → abi/x86_asm.S} +49 -25
- package/src/koffi/src/{abi_x86_asm.asm → abi/x86_asm.asm} +11 -14
- package/src/koffi/src/call.cc +458 -598
- package/src/koffi/src/call.hh +61 -82
- package/src/koffi/src/ffi.cc +595 -309
- package/src/koffi/src/ffi.hh +103 -89
- package/src/koffi/src/parser.cc +0 -4
- package/src/koffi/src/primitives.inc +39 -0
- package/src/koffi/{tools/write_trampolines.js → src/trampolines.js} +1 -1
- package/src/koffi/src/util.cc +503 -446
- package/src/koffi/src/util.hh +269 -57
- package/src/koffi/src/uv.cc +2 -2
- package/src/koffi/src/uv.def +3 -0
- package/src/koffi/src/win32.hh +30 -1
- package/vendor/node-addon-api/napi-inl.h +4 -0
- package/vendor/node-addon-api/napi.h +1 -0
- package/build/koffi/linux_armhf/koffi.node +0 -0
- package/build/koffi/linux_loong64/koffi.node +0 -0
- package/build/koffi/linux_riscv64d/koffi.node +0 -0
- package/build/koffi/win32_arm64/koffi.exp +0 -0
- package/build/koffi/win32_arm64/koffi.lib +0 -0
- package/build/koffi/win32_arm64/koffi.node +0 -0
- package/doc/platforms.md +0 -36
- package/src/cnoke/LICENSE.txt +0 -22
- package/src/cnoke/README.md +0 -99
- package/src/cnoke/assets/FindCNoke.cmake +0 -127
- package/src/cnoke/assets/toolchains.json +0 -126
- package/src/cnoke/assets/win_delay_hook.c +0 -36
- package/src/cnoke/cnoke.js +0 -170
- package/src/cnoke/package.json +0 -24
- package/src/cnoke/src/builder.js +0 -511
- package/src/cnoke/src/index.js +0 -10
- package/src/cnoke/src/tools.js +0 -407
- package/src/koffi/src/abi_arm64.cc +0 -1295
- package/src/koffi/src/abi_x64_sysv.cc +0 -939
- package/src/koffi/src/abi_x64_win.cc +0 -715
- package/src/koffi/src/abi_x86.cc +0 -860
- package/src/koffi/src/init.js +0 -105
- /package/src/koffi/src/{abi_loong64.cc → abi/loong64.cc} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
*Released on 2026-04-03*
|
|
61
61
|
|
|
62
|
-
- Fix
|
|
62
|
+
- Fix "IsOnCentralStack()" assertion/crash when using callbacks in recent Node versions
|
|
63
63
|
- Support SetUnhandledExceptionFilter on Windows x64 and x86 ([@longhun12346](https://github.com/longhun12346))
|
|
64
64
|
- Fix incorrect stack alignment when relaying callbacks on 32-bit x86 platforms
|
|
65
65
|
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
|
|
76
76
|
#### Koffi 2.15.1
|
|
77
77
|
|
|
78
|
-
*Released on
|
|
78
|
+
*Released on 2026-01-24*
|
|
79
79
|
|
|
80
80
|
- Fix possible union-related crashes
|
|
81
81
|
- Support MinGW-w64 x64 builds on Windows
|
package/README.md
CHANGED
|
@@ -9,14 +9,14 @@ Koffi is a fast and easy-to-use C FFI module for Node.js, featuring:
|
|
|
9
9
|
|
|
10
10
|
The following combinations of OS and architectures __are officially supported and tested__ at the moment:
|
|
11
11
|
|
|
12
|
-
ISA / OS | Windows | Linux
|
|
13
|
-
------------------ | ----------- |
|
|
14
|
-
x86 (IA32) [^1] | ✅ Yes | ✅ Yes
|
|
15
|
-
x86_64 (AMD64) | ✅ Yes | ✅ Yes
|
|
16
|
-
ARM32 LE [^2] | ⬜️ *N/A* | ✅ Yes
|
|
17
|
-
ARM64 (AArch64) LE | ✅ Yes | ✅ Yes
|
|
18
|
-
RISC-V 64 [^3] | ⬜️ *N/A* | ✅ Yes
|
|
19
|
-
LoongArch64 | ⬜️ *N/A* | ✅ Yes
|
|
12
|
+
ISA / OS | Windows | Linux/glibc | Linux/musl | macOS | FreeBSD | OpenBSD
|
|
13
|
+
------------------ | ----------- | ----------- | ----------- | ----------- | ----------- | --------
|
|
14
|
+
x86 (IA32) [^1] | ✅ Yes | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | ✅ Yes | ✅ Yes
|
|
15
|
+
x86_64 (AMD64) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes
|
|
16
|
+
ARM32 LE [^2] | ⬜️ *N/A* | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
17
|
+
ARM64 (AArch64) LE | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | 🟨 Probably
|
|
18
|
+
RISC-V 64 [^3] | ⬜️ *N/A* | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
19
|
+
LoongArch64 | ⬜️ *N/A* | ✅ Yes | 🟨 Probably | ⬜️ *N/A* | 🟨 Probably | 🟨 Probably
|
|
20
20
|
|
|
21
21
|
[^1]: The following call conventions are supported: cdecl, stdcall, MS fastcall, thiscall.
|
|
22
22
|
[^2]: The prebuilt binary uses the hard float ABI and expects a VFP coprocessor. Build from source to use Koffi with a different ABI (softfp, soft).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/doc/benchmarks.md
CHANGED
|
@@ -15,7 +15,7 @@ These results are detailed and explained below, and compared to node-ffi/node-ff
|
|
|
15
15
|
|
|
16
16
|
# Linux x86_64
|
|
17
17
|
|
|
18
|
-
The results presented below were measured on my x86_64 Linux machine (
|
|
18
|
+
The results presented below were measured on my x86_64 Linux machine (Intel® Core™ Ultra 9 185H).
|
|
19
19
|
|
|
20
20
|
## rand results
|
|
21
21
|
|
|
@@ -25,11 +25,11 @@ This test is based around repeated calls to a simple standard C function `rand`,
|
|
|
25
25
|
- the second one calls rand through Koffi
|
|
26
26
|
- the third one uses the official Node.js FFI implementation, node-ffi-napi
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
rand | Iteration time | Relative performance | Overhead
|
|
29
29
|
------------- | -------------- | -------------------- | --------
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
napi | 256 ns | x1.00 | +0%
|
|
31
|
+
koffi | 375 ns | x0.68 | +46%
|
|
32
|
+
node-ffi-napi | 29783 ns | x0.009 | +11544%
|
|
33
33
|
|
|
34
34
|
Because rand is a pretty small function, the FFI overhead is clearly visible.
|
|
35
35
|
|
|
@@ -37,11 +37,11 @@ Because rand is a pretty small function, the FFI overhead is clearly visible.
|
|
|
37
37
|
|
|
38
38
|
This test is similar to the rand one, but it is based on `atoi`, which takes a string parameter. Javascript (V8) to C string conversion is relatively slow and heavy.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
atoi | Iteration time | Relative performance | Overhead
|
|
41
41
|
------------- | -------------- | -------------------- | --------
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
napi | 371 ns | x1.00 | +0%
|
|
43
|
+
koffi | 557 ns | x0.67 | +50%
|
|
44
|
+
node-ffi-napi | 104340 ns | x0.004 | +27988%
|
|
45
45
|
|
|
46
46
|
Because atoi is a pretty small function, the FFI overhead is clearly visible.
|
|
47
47
|
|
|
@@ -52,12 +52,12 @@ This benchmark uses the CPU-based image drawing functions in Raylib. The calls a
|
|
|
52
52
|
- Baseline: Full C++ version of the code (no JS)
|
|
53
53
|
- [node-raylib](https://github.com/RobLoach/node-raylib): This is a native wrapper implemented with N-API
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
raylib | Iteration time | Relative performance | Overhead
|
|
56
|
+
------------- | -------------- | -------------------- | --------
|
|
57
|
+
C++ | 10.8 µs | x1.14 | -12%
|
|
58
|
+
node-raylib | 12.3 µs | x1.00 | +0%
|
|
59
|
+
koffi | 13.2 µs | x0.92 | +8%
|
|
60
|
+
node-ffi-napi | 80.3 µs | x0.15 | +555%
|
|
61
61
|
|
|
62
62
|
# Windows x86_64
|
|
63
63
|
|
|
@@ -71,11 +71,11 @@ This test is based around repeated calls to a simple standard C function `rand`,
|
|
|
71
71
|
- the second one calls rand through Koffi
|
|
72
72
|
- the third one uses the official Node.js FFI implementation, node-ffi-napi
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
rand | Iteration time | Relative performance | Overhead
|
|
75
75
|
------------- | -------------- | -------------------- | --------
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
napi | 859 ns | x1.00 | (ref)
|
|
77
|
+
koffi | 1352 ns | x0.64 | +57%
|
|
78
|
+
node-ffi-napi | 35640 ns | x0.02 | +4048%
|
|
79
79
|
|
|
80
80
|
Because rand is a pretty small function, the FFI overhead is clearly visible.
|
|
81
81
|
|
|
@@ -85,11 +85,11 @@ This test is similar to the rand one, but it is based on `atoi`, which takes a s
|
|
|
85
85
|
|
|
86
86
|
The results below were measured on my x86_64 Windows machine (Intel® Core™ i5-4460):
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
atoi | Iteration time | Relative performance | Overhead
|
|
89
89
|
------------- | -------------- | -------------------- | --------
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
napi | 1336 ns | x1.00 | (ref)
|
|
91
|
+
koffi | 2440 ns | x0.55 | +83%
|
|
92
|
+
node-ffi-napi | 136890 ns | x0.010 | +10144%
|
|
93
93
|
|
|
94
94
|
Because atoi is a pretty small function, the FFI overhead is clearly visible.
|
|
95
95
|
|
|
@@ -100,23 +100,23 @@ This benchmark uses the CPU-based image drawing functions in Raylib. The calls a
|
|
|
100
100
|
- [node-raylib](https://github.com/RobLoach/node-raylib) (baseline): This is a native wrapper implemented with N-API
|
|
101
101
|
- raylib_cc: C++ implementation of the benchmark, without any Javascript
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
raylib | Iteration time | Relative performance | Overhead
|
|
104
|
+
------------- | -------------- | -------------------- | --------
|
|
105
|
+
C++ | 18.2 µs | x1.50 | -33%
|
|
106
|
+
node-raylib | 27.3 µs | x1.00 | (ref)
|
|
107
|
+
koffi | 29.8 µs | x0.92 | +9%
|
|
108
|
+
node-ffi-napi | 96.3 µs | x0.28 | +253%
|
|
109
109
|
|
|
110
110
|
# Running benchmarks
|
|
111
111
|
|
|
112
112
|
Please note that all benchmark results on this page are made with Clang-built binaries.
|
|
113
113
|
|
|
114
114
|
```sh
|
|
115
|
-
cd koffi
|
|
116
|
-
node
|
|
115
|
+
cd src/koffi
|
|
116
|
+
node ../cnoke/cnoke.js --clang --release
|
|
117
117
|
|
|
118
|
-
cd
|
|
119
|
-
node ../../cnoke/cnoke.js --
|
|
118
|
+
cd benchmark
|
|
119
|
+
node ../../cnoke/cnoke.js --clang --release
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
Once everything is built and ready, run:
|
|
Binary file
|
package/doc/contribute.md
CHANGED
|
@@ -32,6 +32,9 @@ cd src/koffi
|
|
|
32
32
|
node ../cnoke/cnoke.js
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
> [!NOTE]
|
|
36
|
+
> Use `node ../cnoke/cnoke.js --debug` to make debug builds
|
|
37
|
+
|
|
35
38
|
## Other platforms
|
|
36
39
|
|
|
37
40
|
Make sure the following dependencies are met:
|
|
@@ -48,6 +51,9 @@ cd src/koffi
|
|
|
48
51
|
node ../cnoke/cnoke.js
|
|
49
52
|
```
|
|
50
53
|
|
|
54
|
+
> [!NOTE]
|
|
55
|
+
> Use `node ../cnoke/cnoke.js --debug` to make debug builds
|
|
56
|
+
|
|
51
57
|
# Run tests
|
|
52
58
|
|
|
53
59
|
## On your machine
|
|
@@ -56,8 +62,7 @@ Once Koffi is built, you can build the tests and run them with the following com
|
|
|
56
62
|
|
|
57
63
|
```sh
|
|
58
64
|
cd src/koffi/test
|
|
59
|
-
node ../../cnoke/cnoke.js
|
|
60
|
-
|
|
65
|
+
node ../../cnoke/cnoke.js # Build C test code
|
|
61
66
|
node test.js
|
|
62
67
|
```
|
|
63
68
|
|
|
@@ -65,15 +70,20 @@ node test.js
|
|
|
65
70
|
|
|
66
71
|
Koffi is tested on multiple architectures using emulated (accelerated when possible) QEMU machines. First, you need to install qemu packages, such as `qemu-system` (or even `qemu-system-gui`) on Ubuntu.
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
For example, if you want to run the tests on Debian ARM64, run the following commands:
|
|
73
|
+
The Linux machines are based on Debian, they are not included in the repository but they can be created at any time with the scripts in `tools/cross/build`. For example, to create the Debian ARM64 machine, use the following commands:
|
|
71
74
|
|
|
72
75
|
```sh
|
|
73
|
-
cd
|
|
76
|
+
cd tools/cross/build
|
|
77
|
+
./debian_arm64/build.sh
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The other machines (Alpine, FreeBSD, OpenBSD, macOS and Windows) are created manually, at least for now. These machines are not included directly in this repository (for license and size reasons), but they are available here: https://download.koromix.dev/qemu/
|
|
74
81
|
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
For example, if you want to build and test for Windows, run the following commands:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
cd tools/cross/
|
|
86
|
+
wget -q -O- https://download.koromix.dev/qemu/qemu_windows_x64.tar.zst | zstd -d | tar xv
|
|
77
87
|
```
|
|
78
88
|
|
|
79
89
|
Note that the machine disk content may change each time the machine runs, so the checksum test will fail once a machine has been used at least once.
|
|
@@ -81,42 +91,42 @@ Note that the machine disk content may change each time the machine runs, so the
|
|
|
81
91
|
And now you can run the tests with:
|
|
82
92
|
|
|
83
93
|
```sh
|
|
84
|
-
|
|
94
|
+
cd src/koffi
|
|
95
|
+
|
|
96
|
+
node tools/brew.js test # Several options are available, use --help
|
|
85
97
|
```
|
|
86
98
|
|
|
87
99
|
And be patient, this can be pretty slow for emulated machines. The Linux machines have and use ccache to build Koffi, so subsequent build steps will get much more tolerable.
|
|
88
100
|
|
|
89
|
-
|
|
101
|
+
Machines are started for each test if needed, and stay active until you stop them. You can start and stop them at any time with the following commands:
|
|
90
102
|
|
|
91
103
|
```sh
|
|
92
|
-
node
|
|
93
|
-
node
|
|
94
|
-
node qemu.js test # Test again
|
|
95
|
-
node qemu.js stop # Stop everything
|
|
104
|
+
node tools/brew.js start # Start all available machines
|
|
105
|
+
node tools/brew.js stop # Stop everything
|
|
96
106
|
```
|
|
97
107
|
|
|
98
|
-
You can also restrict
|
|
108
|
+
You can also restrict these commands to a subset of machines:
|
|
99
109
|
|
|
100
110
|
```sh
|
|
101
111
|
# Full test cycle
|
|
102
|
-
node
|
|
112
|
+
node tools/brew.js test debian_x64 debian_i386
|
|
103
113
|
|
|
104
114
|
# Separate start, test, shutdown
|
|
105
|
-
node
|
|
106
|
-
node
|
|
107
|
-
node
|
|
115
|
+
node tools/brew.js start debian_x64 debian_i386
|
|
116
|
+
node tools/brew.js test debian_x64 debian_i386
|
|
117
|
+
node tools/brew.js stop
|
|
108
118
|
```
|
|
109
119
|
|
|
110
120
|
Finally, you can join a running machine with SSH with the following shortcut, if you need to do some debugging or any other manual procedure:
|
|
111
121
|
|
|
112
122
|
```sh
|
|
113
|
-
node
|
|
123
|
+
node tools/brew.js ssh debian_i386
|
|
114
124
|
```
|
|
115
125
|
|
|
116
|
-
Each machine is configured to run a VNC server
|
|
126
|
+
Each machine is configured to run a VNC server or SPICE, which you can use to access the display, using KRDC or any other compatible viewer. Use the `info` command to get the VNC or the SPICE port.
|
|
117
127
|
|
|
118
128
|
```sh
|
|
119
|
-
node
|
|
129
|
+
node tools/brew.js info debian_x64
|
|
120
130
|
```
|
|
121
131
|
|
|
122
132
|
# Making a release
|
|
@@ -130,10 +140,12 @@ First, you must update the code in three steps:
|
|
|
130
140
|
Once this is done, you can publish a new release with the following commands:
|
|
131
141
|
|
|
132
142
|
```sh
|
|
133
|
-
|
|
134
|
-
|
|
143
|
+
cd src/koffi
|
|
144
|
+
|
|
145
|
+
node tools/brew.js test # If not done before
|
|
146
|
+
node tools/brew.js build
|
|
135
147
|
|
|
136
|
-
cd
|
|
148
|
+
cd ../../bin/Koffi/package
|
|
137
149
|
npm publish
|
|
138
150
|
```
|
|
139
151
|
|
package/doc/index.md
CHANGED
|
@@ -19,14 +19,14 @@ Koffi requires [Node.js](https://nodejs.org/) version 16 or later. Use [NVM](htt
|
|
|
19
19
|
|
|
20
20
|
The following combinations of OS and architectures __are officially supported and tested__ at the moment:
|
|
21
21
|
|
|
22
|
-
ISA / OS | Windows | Linux
|
|
23
|
-
------------------ | ------- |
|
|
24
|
-
x86 (IA32) [^2] | ✅
|
|
25
|
-
x86_64 (AMD64) | ✅
|
|
26
|
-
ARM32 LE [^3] | ⬜️
|
|
27
|
-
ARM64 (AArch64) LE | ✅
|
|
28
|
-
RISC-V 64 [^4] | ⬜️
|
|
29
|
-
LoongArch64 | ⬜️
|
|
22
|
+
ISA / OS | Windows | Linux/glibc | Linux/musl | macOS | FreeBSD | OpenBSD
|
|
23
|
+
------------------ | ------- | ----------- | ---------- | ----- | ------- | -------
|
|
24
|
+
x86 (IA32) [^2] | ✅ | ✅ | 🟨 | ⬜️ | ✅ | ✅
|
|
25
|
+
x86_64 (AMD64) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅
|
|
26
|
+
ARM32 LE [^3] | ⬜️ | ✅ | 🟨 | ⬜️ | 🟨 | 🟨
|
|
27
|
+
ARM64 (AArch64) LE | ✅ | ✅ | ✅ | ✅ | ✅ | 🟨
|
|
28
|
+
RISC-V 64 [^4] | ⬜️ | ✅ | 🟨 | ⬜️ | 🟨 | 🟨
|
|
29
|
+
LoongArch64 | ⬜️ | ✅ | 🟨 | ⬜️ | 🟨 | 🟨
|
|
30
30
|
|
|
31
31
|
<div class="legend">✅ Yes | 🟨 Probably | ⬜️ Not applicable</div>
|
|
32
32
|
|
package/doc/variables.md
CHANGED
|
@@ -17,7 +17,7 @@ const my_string = lib.symbol('my_string', 'const char *');
|
|
|
17
17
|
You cannot directly manipulate these variables, use:
|
|
18
18
|
|
|
19
19
|
- [koffi.decode()](#decode-to-js-values) to read their value
|
|
20
|
-
- [koffi.encode()](#encode-to-c-memory) to change their
|
|
20
|
+
- [koffi.encode()](#encode-to-c-memory) to change their value
|
|
21
21
|
|
|
22
22
|
# Decode to JS values
|
|
23
23
|
|
package/index.d.ts
CHANGED
|
@@ -145,13 +145,15 @@ export function introspect(type: TypeSpec): TypeInfo;
|
|
|
145
145
|
export function alias(name: string, type: TypeSpec): IKoffiCType;
|
|
146
146
|
|
|
147
147
|
type KoffiConfig = {
|
|
148
|
-
sync_stack_size?: number
|
|
149
|
-
sync_heap_size?: number
|
|
150
|
-
async_stack_size?: number
|
|
151
|
-
async_heap_size?: number
|
|
152
|
-
resident_async_pools?: number
|
|
153
|
-
max_async_calls?: number
|
|
154
|
-
max_type_size?: number
|
|
148
|
+
sync_stack_size?: number;
|
|
149
|
+
sync_heap_size?: number;
|
|
150
|
+
async_stack_size?: number;
|
|
151
|
+
async_heap_size?: number;
|
|
152
|
+
resident_async_pools?: number;
|
|
153
|
+
max_async_calls?: number;
|
|
154
|
+
max_type_size?: number;
|
|
155
|
+
fast_pointers?: boolean;
|
|
156
|
+
fast_callbacks?: boolean;
|
|
155
157
|
};
|
|
156
158
|
type KoffiStats = {
|
|
157
159
|
disposed: number
|
|
@@ -169,8 +171,8 @@ export function errno(value: number): number;
|
|
|
169
171
|
|
|
170
172
|
export function reset(): void;
|
|
171
173
|
|
|
172
|
-
export const internal:
|
|
173
|
-
export const extension:
|
|
174
|
+
export const internal: boolean;
|
|
175
|
+
export const extension: string;
|
|
174
176
|
|
|
175
177
|
export const os: {
|
|
176
178
|
errno: Record<string, number>
|