koffi 2.16.0 → 3.0.0-alpha.1

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +10 -3
  2. package/README.md +8 -8
  3. package/build/koffi/darwin_arm64/koffi.node +0 -0
  4. package/build/koffi/darwin_x64/koffi.node +0 -0
  5. package/build/koffi/freebsd_arm64/koffi.node +0 -0
  6. package/build/koffi/freebsd_ia32/koffi.node +0 -0
  7. package/build/koffi/freebsd_x64/koffi.node +0 -0
  8. package/build/koffi/linux_arm64/koffi.node +0 -0
  9. package/build/koffi/linux_ia32/koffi.node +0 -0
  10. package/build/koffi/linux_x64/koffi.node +0 -0
  11. package/build/koffi/musl_arm64/koffi.node +0 -0
  12. package/build/koffi/musl_x64/koffi.node +0 -0
  13. package/build/koffi/openbsd_ia32/koffi.node +0 -0
  14. package/build/koffi/openbsd_x64/koffi.node +0 -0
  15. package/build/koffi/win32_ia32/koffi.node +0 -0
  16. package/build/koffi/win32_x64/koffi.node +0 -0
  17. package/doc/benchmarks.md +33 -33
  18. package/doc/benchmarks.xlsx +0 -0
  19. package/doc/contribute.md +37 -25
  20. package/doc/index.md +8 -8
  21. package/doc/variables.md +1 -1
  22. package/index.d.ts +11 -9
  23. package/index.js +139 -145
  24. package/indirect.js +57 -59
  25. package/lib/native/base/base.hh +53 -31
  26. package/package.json +2 -2
  27. package/src/cnoke/cnoke.js +13 -3
  28. package/src/cnoke/src/builder.js +4 -1
  29. package/src/koffi/CMakeLists.txt +56 -32
  30. package/src/koffi/src/{abi_arm32.cc → abi/arm32.cc} +280 -284
  31. package/src/koffi/src/{abi_arm32_asm.S → abi/arm32_asm.S} +2 -5
  32. package/src/koffi/src/abi/arm64.cc +1504 -0
  33. package/src/koffi/src/{abi_arm64_asm.S → abi/arm64_asm.S} +44 -23
  34. package/src/koffi/src/{abi_arm64_asm.asm → abi/arm64_asm.asm} +32 -25
  35. package/src/koffi/src/{abi_loong64_asm.S → abi/loong64_asm.S} +3 -7
  36. package/src/koffi/src/{abi_riscv64.cc → abi/riscv64.cc} +280 -282
  37. package/src/koffi/src/{abi_riscv64_asm.S → abi/riscv64_asm.S} +3 -6
  38. package/src/koffi/src/abi/x64sysv.cc +1446 -0
  39. package/src/koffi/src/{abi_x64_sysv_asm.S → abi/x64sysv_asm.S} +30 -33
  40. package/src/koffi/src/abi/x64win.cc +1114 -0
  41. package/src/koffi/src/{abi_x64_win_asm.S → abi/x64win_asm.S} +10 -14
  42. package/src/koffi/src/{abi_x64_win_asm.asm → abi/x64win_asm.asm} +11 -14
  43. package/src/koffi/src/abi/x86.cc +1239 -0
  44. package/src/koffi/src/{abi_x86_asm.S → abi/x86_asm.S} +53 -27
  45. package/src/koffi/src/{abi_x86_asm.asm → abi/x86_asm.asm} +13 -14
  46. package/src/koffi/src/call.cc +465 -600
  47. package/src/koffi/src/call.hh +63 -75
  48. package/src/koffi/src/ffi.cc +580 -298
  49. package/src/koffi/src/ffi.hh +113 -88
  50. package/src/koffi/src/parser.cc +0 -4
  51. package/src/koffi/src/primitives.inc +39 -0
  52. package/src/koffi/src/util.cc +392 -266
  53. package/src/koffi/src/util.hh +232 -51
  54. package/src/koffi/src/uv.cc +2 -2
  55. package/src/koffi/src/uv.def +3 -0
  56. package/src/koffi/src/win32.hh +12 -0
  57. package/vendor/node-addon-api/napi-inl.h +4 -0
  58. package/vendor/node-addon-api/napi.h +1 -0
  59. package/build/koffi/linux_armhf/koffi.node +0 -0
  60. package/build/koffi/linux_loong64/koffi.node +0 -0
  61. package/build/koffi/linux_riscv64d/koffi.node +0 -0
  62. package/build/koffi/win32_arm64/koffi.exp +0 -0
  63. package/build/koffi/win32_arm64/koffi.lib +0 -0
  64. package/build/koffi/win32_arm64/koffi.node +0 -0
  65. package/doc/platforms.md +0 -36
  66. package/src/koffi/src/abi_arm64.cc +0 -1321
  67. package/src/koffi/src/abi_x64_sysv.cc +0 -947
  68. package/src/koffi/src/abi_x64_win.cc +0 -739
  69. package/src/koffi/src/abi_x86.cc +0 -886
  70. package/src/koffi/src/init.js +0 -105
  71. /package/src/koffi/src/{abi_loong64.cc → abi/loong64.cc} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@
7
7
 
8
8
  ### Koffi 2.16
9
9
 
10
+ #### Koffi 2.16.1
11
+
12
+ *Released on 2026-04-17*
13
+
14
+ - Fix possible stack check crash when relaying callbacks on Windows
15
+ - Improve exception handling inside callbacks
16
+
10
17
  #### Koffi 2.16.0
11
18
 
12
19
  *Released on 2026-04-14*
@@ -14,7 +21,7 @@
14
21
  - Support buffers and typed arrays in `koffi.address()`
15
22
  - Put x86 SEH record at the top of stack frame
16
23
  - Optimize Koffi binaries produced by GCC (with `-fno-semantic-interposition`)
17
- - Fix nonsensical addresses in Koffi call dumps (when using DUMP_CALLS=1 environement variable)
24
+ - Fix nonsensical addresses in Koffi call dumps (when using DUMP_CALLS=1 environment variable)
18
25
 
19
26
  - Reduce Koffi package size even more:
20
27
  * Replace table of callback trampoline pointers with simple offset computation
@@ -52,7 +59,7 @@
52
59
 
53
60
  *Released on 2026-04-03*
54
61
 
55
- - Fix *IsOnCentralStack()* assertion/crash when using callbacks in recent Node versions
62
+ - Fix "IsOnCentralStack()" assertion/crash when using callbacks in recent Node versions
56
63
  - Support SetUnhandledExceptionFilter on Windows x64 and x86 ([@longhun12346](https://github.com/longhun12346))
57
64
  - Fix incorrect stack alignment when relaying callbacks on 32-bit x86 platforms
58
65
 
@@ -68,7 +75,7 @@
68
75
 
69
76
  #### Koffi 2.15.1
70
77
 
71
- *Released on 2025-01-24*
78
+ *Released on 2026-01-24*
72
79
 
73
80
  - Fix possible union-related crashes
74
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 (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
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
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 (AMD Ryzen5 2600).
18
+ The results presented below were measured on my x86_64 Linux machine (Intel® CoreUltra 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
- Benchmark | Iteration time | Relative performance | Overhead
28
+ rand | Iteration time | Relative performance | Overhead
29
29
  ------------- | -------------- | -------------------- | --------
30
- rand_napi | 569 ns | x1.00 | (ref)
31
- rand_koffi | 855 ns | x0.67 | +50%
32
- rand_node_ffi | 58730 ns | x0.010 | +10228%
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
- Benchmark | Iteration time | Relative performance | Overhead
40
+ atoi | Iteration time | Relative performance | Overhead
41
41
  ------------- | -------------- | -------------------- | --------
42
- atoi_napi | 1039 ns | x1.00 | (ref)
43
- atoi_koffi | 1642 ns | x0.63 | +58%
44
- atoi_node_ffi | 164790 ns | x0.006 | +15767%
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
- Benchmark | Iteration time | Relative performance | Overhead
56
- ------------------ | -------------- | -------------------- | --------
57
- raylib_cc | 17.5 µs | x1.34 | -25%
58
- raylib_node_raylib | 23.4 µs | x1.00 | (ref)
59
- raylib_koffi | 28.8 µs | x0.81 | +23%
60
- raylib_node_ffi | 103.9 µs | x0.23 | +344%
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
- Benchmark | Iteration time | Relative performance | Overhead
74
+ rand | Iteration time | Relative performance | Overhead
75
75
  ------------- | -------------- | -------------------- | --------
76
- rand_napi | 859 ns | x1.00 | (ref)
77
- rand_koffi | 1352 ns | x0.64 | +57%
78
- rand_node_ffi | 35640 ns | x0.02 | +4048%
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
- Benchmark | Iteration time | Relative performance | Overhead
88
+ atoi | Iteration time | Relative performance | Overhead
89
89
  ------------- | -------------- | -------------------- | --------
90
- atoi_napi | 1336 ns | x1.00 | (ref)
91
- atoi_koffi | 2440 ns | x0.55 | +83%
92
- atoi_node_ffi | 136890 ns | x0.010 | +10144%
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
- Benchmark | Iteration time | Relative performance | Overhead
104
- ------------------ | -------------- | -------------------- | --------
105
- raylib_cc | 18.2 µs | x1.50 | -33%
106
- raylib_node_raylib | 27.3 µs | x1.00 | (ref)
107
- raylib_koffi | 29.8 µs | x0.92 | +9%
108
- raylib_node_ffi | 96.3 µs | x0.28 | +253%
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 ../../cnoke/cnoke.js --prefer-clang
115
+ cd src/koffi
116
+ node ../cnoke/cnoke.js --clang --release
117
117
 
118
- cd koffi/benchmark
119
- node ../../cnoke/cnoke.js --prefer-clang
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
- These machines are not included directly in this repository (for license and size reasons), but they are available here: https://koromix.dev/files/machines/
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 deploy/qemu/
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
- wget -q -O- https://koromix.dev/files/machines/qemu_debian_arm64.tar.zst | zstd -d | tar xv
76
- b3sum -c b3sum.txt
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
- node qemu.js test # Several options are available, use --help
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
- By default, machines are started and stopped for each test. But you can start the machines ahead of time and run the tests multiple times instead:
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 qemu.js start # Start the machines
93
- node qemu.js test # Test (without shutting down)
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 the test to a subset of machines:
108
+ You can also restrict these commands to a subset of machines:
99
109
 
100
110
  ```sh
101
111
  # Full test cycle
102
- node qemu.js test debian_x64 debian_i386
112
+ node tools/brew.js test debian_x64 debian_i386
103
113
 
104
114
  # Separate start, test, shutdown
105
- node qemu.js start debian_x64 debian_i386
106
- node qemu.js test debian_x64 debian_i386
107
- node qemu.js stop
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 qemu.js ssh debian_i386
123
+ node tools/brew.js ssh debian_i386
114
124
  ```
115
125
 
116
- Each machine is configured to run a VNC server available locally, which you can use to access the display, using KRDC or any other compatible viewer. Use the `info` command to get the VNC port.
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 qemu.js info debian_x64
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
- node tools/qemu.js test # If not done before
134
- node tools/qemu.js build
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 build/dist
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 (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 | ⬜️ | ✅ | 🟨 | ⬜️ | 🟨 | 🟨
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 valuèe
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: Boolean;
173
- export const extension: String;
174
+ export const internal: boolean;
175
+ export const extension: string;
174
176
 
175
177
  export const os: {
176
178
  errno: Record<string, number>