node-ctypes 2.13.0 → 2.13.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 +75 -2
- package/README.md +24 -1171
- package/build/Release/ctypes-darwin-arm64.node +0 -0
- package/build/Release/ctypes-darwin-x64.node +0 -0
- package/build/Release/ctypes-linux-arm64-musl.node +0 -0
- package/build/Release/ctypes-linux-arm64.node +0 -0
- package/build/Release/ctypes-linux-x64-musl.node +0 -0
- package/build/Release/ctypes-linux-x64.node +0 -0
- package/build/Release/ctypes-win32-arm64.node +0 -0
- package/build/Release/ctypes-win32-x64.node +0 -0
- package/lib/core/conversions.js +78 -6
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,77 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.13.2] - 2026-11-15
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **libffi 3.8.1**: the submodule moves from upstream commit `d02afc25` to the
|
|
15
|
+
v3.8.1 tag, with two fixes that node-ctypes could reach on ARM64:
|
|
16
|
+
- a struct larger than 16 bytes (other than an HFA) passed by value after the
|
|
17
|
+
integer registers, after a narrow stack argument on macOS (stack arguments
|
|
18
|
+
are packed there) or with `_align_ = 16` elsewhere, had the pointer to its
|
|
19
|
+
copy in a misaligned stack slot: the C function read another address and
|
|
20
|
+
could crash ([GHSA-h52h-3759-xqm4](https://github.com/libffi/libffi/security/advisories/GHSA-h52h-3759-xqm4)).
|
|
21
|
+
The tests skipped on Darwin ARM64 for this limitation run again;
|
|
22
|
+
- on macOS ARM64, with more than 1024 live callbacks, some orders of
|
|
23
|
+
`release()` wrote into a freed trampoline table
|
|
24
|
+
([GHSA-23hx-9rxv-9qfp](https://github.com/libffi/libffi/security/advisories/GHSA-23hx-9rxv-9qfp)).
|
|
25
|
+
|
|
26
|
+
The other fixes of the release concern types node-ctypes does not expose
|
|
27
|
+
(`long double`, vectors) or platforms and APIs it does not use. The generated
|
|
28
|
+
headers report 3.8.1.
|
|
29
|
+
|
|
30
|
+
### Documentation
|
|
31
|
+
|
|
32
|
+
- **Guides**: the reference sections of the README moved, unchanged, to
|
|
33
|
+
`guides/` (libraries and functions, types, structures, memory, callbacks,
|
|
34
|
+
asynchronous calls, errors, Windows API, TypeScript, Python ctypes parity,
|
|
35
|
+
building and testing), also published on the documentation site. The README
|
|
36
|
+
keeps the quick start, the supported platforms and the list of guides. New
|
|
37
|
+
pages: Getting started (installation, supported platforms, building from
|
|
38
|
+
source), Coming from Koffi (the Koffi API mapped to node-ctypes) and
|
|
39
|
+
Performance (results of the Koffi comparison, with charts, and how to run
|
|
40
|
+
it). The paragraph on direct calls now describes the register-frame calls.
|
|
41
|
+
- **Benchmark charts**: `npm run bench:charts -- report.json` writes static
|
|
42
|
+
SVG charts (ratio summary and one chart per workload group, light and dark)
|
|
43
|
+
from the JSON report of `bench:koffi` or `bench:ffi` (`--output`), into
|
|
44
|
+
`guides/images/` or the `--out` directory.
|
|
45
|
+
|
|
46
|
+
## [2.13.1] - 2026-11-14
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- **Argument conversion order through the JavaScript wrapper**: as in CPython,
|
|
51
|
+
where each argument goes through `from_param` and its C conversion before
|
|
52
|
+
the next one, a scalar argument the native call rejects now fails before the
|
|
53
|
+
converters of the later arguments run. Before, with `errcheck`,
|
|
54
|
+
`use_last_error`/`use_errno`, `callAsync` or an object among the
|
|
55
|
+
arguments, the `_as_parameter_` getters and `from_param` of the later
|
|
56
|
+
arguments ran first and the error came afterwards. Values the call accepts
|
|
57
|
+
as they are (integral numbers, booleans and BigInts for integers, numbers for
|
|
58
|
+
floats, one-character strings for `c_char`/`c_wchar`) are checked in
|
|
59
|
+
JavaScript; the others, objects included, by the native conversion itself
|
|
60
|
+
(`checkArgument`), so the rules and the `ArgumentError` messages are those
|
|
61
|
+
of the call. The native check returns the converted C value, so the
|
|
62
|
+
conversion is complete before the next argument: a later adapter changing a
|
|
63
|
+
Buffer passed to `c_char` no longer changes what C receives (as a
|
|
64
|
+
`bytearray` in CPython); memory passed by address (a Buffer for a 64-bit
|
|
65
|
+
integer) stays the original value. Scalar `CType` numbers as argtypes follow
|
|
66
|
+
the same order. Too few arguments are still reported first, as
|
|
67
|
+
"Expected N arguments, got M". The extra cost is a few nanoseconds per scalar
|
|
68
|
+
argument converted by the JavaScript wrapper, and the native check for
|
|
69
|
+
unusual values; calls through the native entry function are unchanged.
|
|
70
|
+
- **Flaky Executor test** (cancellation after an inline completion): on a
|
|
71
|
+
loaded machine the inline waits expired, the per-function backoff then
|
|
72
|
+
skipped the next ones and the 1 ms of inline completions per event loop turn
|
|
73
|
+
was spent by the warm-up calls, so no attempt produced the inline completion
|
|
74
|
+
the test needs. Each attempt now uses a new executor with the longest wait,
|
|
75
|
+
started with another function, and a fresh event loop turn; when the machine
|
|
76
|
+
is so loaded that the executor thread never runs within 10 ms, the test is
|
|
77
|
+
skipped with that reason instead of failing. The attempts stop after 3 s, so
|
|
78
|
+
the skip comes within the 5 s test timeout; a second test checks that the
|
|
79
|
+
attempts without inline completions (`spin: 0`) stop at their time budget.
|
|
80
|
+
|
|
10
81
|
## [2.13.0] - 2026-11-14
|
|
11
82
|
|
|
12
83
|
### Changed
|
|
@@ -1082,7 +1153,7 @@ number, not string`).
|
|
|
1082
1153
|
|
|
1083
1154
|
2.0 aligns node-ctypes with Python ctypes as closely as the language allows,
|
|
1084
1155
|
so that Python code can be ported with only the changes JavaScript requires.
|
|
1085
|
-
It contains breaking changes: see [Migrating from 1.x](
|
|
1156
|
+
It contains breaking changes: see [Migrating from 1.x](guides/python.md#migrating-from-1x).
|
|
1086
1157
|
|
|
1087
1158
|
### Breaking changes
|
|
1088
1159
|
|
|
@@ -1396,7 +1467,9 @@ It contains breaking changes: see [Migrating from 1.x](README.md#migrating-from-
|
|
|
1396
1467
|
|
|
1397
1468
|
Initial releases.
|
|
1398
1469
|
|
|
1399
|
-
[Unreleased]: https://github.com/dmazzella/node-ctypes/compare/v2.13.
|
|
1470
|
+
[Unreleased]: https://github.com/dmazzella/node-ctypes/compare/v2.13.2...HEAD
|
|
1471
|
+
[2.13.2]: https://github.com/dmazzella/node-ctypes/compare/v2.13.1...v2.13.2
|
|
1472
|
+
[2.13.1]: https://github.com/dmazzella/node-ctypes/compare/v2.13.0...v2.13.1
|
|
1400
1473
|
[2.13.0]: https://github.com/dmazzella/node-ctypes/compare/v2.12.2...v2.13.0
|
|
1401
1474
|
[2.12.2]: https://github.com/dmazzella/node-ctypes/compare/v2.12.1...v2.12.2
|
|
1402
1475
|
[2.12.1]: https://github.com/dmazzella/node-ctypes/compare/v2.12.0...v2.12.1
|