koffi 1.3.2 → 1.3.3
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/CMakeLists.txt +26 -2
- package/ChangeLog.md +28 -14
- package/build/qemu/1.3.3/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/1.3.3/koffi_win32_x64.tar.gz +0 -0
- package/doc/_static/perf_linux_20220623.png +0 -0
- package/doc/_static/perf_linux_20220623_2.png +0 -0
- package/doc/_static/perf_windows_20220623.png +0 -0
- package/doc/_static/perf_windows_20220623_2.png +0 -0
- package/doc/benchmarks.md +40 -36
- package/doc/benchmarks.xlsx +0 -0
- package/doc/changes.md +2 -0
- package/doc/conf.py +10 -3
- package/doc/contribute.md +16 -0
- package/doc/dist/doctrees/benchmarks.doctree +0 -0
- package/doc/dist/doctrees/changes.doctree +0 -0
- package/doc/dist/doctrees/contribute.doctree +0 -0
- package/doc/dist/doctrees/environment.pickle +0 -0
- package/doc/dist/doctrees/functions.doctree +0 -0
- package/doc/dist/doctrees/index.doctree +0 -0
- package/doc/dist/doctrees/platforms.doctree +0 -0
- package/doc/dist/html/_sources/benchmarks.md.txt +40 -36
- package/doc/dist/html/_sources/changes.md.txt +2 -0
- package/doc/dist/html/_sources/contribute.md.txt +16 -0
- package/doc/dist/html/_sources/functions.md.txt +2 -0
- package/doc/dist/html/_sources/index.rst.txt +2 -1
- package/doc/dist/html/_sources/platforms.md.txt +2 -0
- package/doc/dist/html/_static/perf_linux_20220623.png +0 -0
- package/doc/dist/html/_static/perf_linux_20220623_2.png +0 -0
- package/doc/dist/html/_static/perf_windows_20220623.png +0 -0
- package/doc/dist/html/_static/perf_windows_20220623_2.png +0 -0
- package/doc/dist/html/benchmarks.html +52 -20
- package/doc/dist/html/changes.html +369 -0
- package/doc/dist/html/contribute.html +24 -2
- package/doc/dist/html/functions.html +2 -0
- package/doc/dist/html/genindex.html +1 -0
- package/doc/dist/html/index.html +13 -1
- package/doc/dist/html/memory.html +1 -0
- package/doc/dist/html/objects.inv +0 -0
- package/doc/dist/html/platforms.html +2 -0
- package/doc/dist/html/search.html +1 -0
- package/doc/dist/html/searchindex.js +1 -1
- package/doc/dist/html/start.html +1 -0
- package/doc/dist/html/types.html +1 -0
- package/doc/functions.md +2 -0
- package/doc/index.rst +2 -1
- package/doc/platforms.md +2 -0
- package/package.json +1 -1
- package/qemu/qemu.js +1 -0
- package/src/abi_arm32.cc +9 -9
- package/src/abi_arm64.cc +9 -9
- package/src/abi_riscv64.cc +9 -9
- package/src/abi_x64_sysv.cc +9 -9
- package/src/abi_x64_win.cc +9 -9
- package/src/abi_x86.cc +9 -9
- package/src/call.cc +6 -6
- package/src/call.hh +6 -0
- package/src/ffi.cc +2 -0
- package/src/parser.cc +1 -1
- package/src/util.hh +21 -1
- package/test/misc.c +20 -0
- package/test/sync.js +13 -3
- package/vendor/libcc/libcc.hh +1 -1
- package/build/qemu/1.3.2/koffi_darwin_arm64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_darwin_x64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_freebsd_arm64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_freebsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_freebsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_linux_arm32hf.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_linux_arm64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_linux_ia32.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_linux_riscv64hf64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_linux_x64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_openbsd_ia32.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_openbsd_x64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_win32_arm64.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_win32_ia32.tar.gz +0 -0
- package/build/qemu/1.3.2/koffi_win32_x64.tar.gz +0 -0
|
@@ -169,6 +169,7 @@
|
|
|
169
169
|
<li class="toctree-l1"><a class="reference internal" href="memory">Memory usage</a></li>
|
|
170
170
|
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Benchmarks</a></li>
|
|
171
171
|
<li class="toctree-l1"><a class="reference internal" href="contribute">Contributing</a></li>
|
|
172
|
+
<li class="toctree-l1"><a class="reference internal" href="changes">Changelog</a></li>
|
|
172
173
|
</ul>
|
|
173
174
|
|
|
174
175
|
</div>
|
|
@@ -204,11 +205,16 @@
|
|
|
204
205
|
<article role="main">
|
|
205
206
|
<section id="benchmarks">
|
|
206
207
|
<h1>Benchmarks<a class="headerlink" href="#benchmarks" title="Permalink to this heading">#</a></h1>
|
|
207
|
-
<p>Here is a quick overview of the execution time of Koffi calls on three
|
|
208
|
+
<p>Here is a quick overview of the execution time of Koffi calls on three benchmarks, where it is compared to a theoretical ideal FFI implementation (approximated with pre-compiled static N-API glue code):</p>
|
|
209
|
+
<ul class="simple">
|
|
210
|
+
<li><p>The first benchmark is based on <code class="docutils literal notranslate"><span class="pre">rand()</span></code> calls</p></li>
|
|
211
|
+
<li><p>The second benchmark is based on <code class="docutils literal notranslate"><span class="pre">atoi()</span></code> calls</p></li>
|
|
212
|
+
<li><p>The third benchmark is based on <a class="reference external" href="https://www.raylib.com/">Raylib</a></p></li>
|
|
213
|
+
</ul>
|
|
208
214
|
<table style="margin: 0 auto;">
|
|
209
215
|
<tr>
|
|
210
|
-
<td><img src="_static/
|
|
211
|
-
<td><img src="_static/
|
|
216
|
+
<td><a href="_static/perf_linux_20220623_2.png" target="_blank"><img src="_static/perf_linux_20220623_2.png" alt="Linux performance" style="width: 350px;"/></a></td>
|
|
217
|
+
<td><a href="_static/perf_windows_20220623_2.png" target="_blank"><img src="_static/perf_windows_20220623_2.png" alt="Windows performance" style="width: 350px;"/></a></td>
|
|
212
218
|
</tr>
|
|
213
219
|
</table>
|
|
214
220
|
<p>These results are detailed and explained below, and compared to node-ffi/node-ffi-napi.</p>
|
|
@@ -216,7 +222,7 @@
|
|
|
216
222
|
<h2>rand results<a class="headerlink" href="#rand-results" title="Permalink to this heading">#</a></h2>
|
|
217
223
|
<p>This test is based around repeated calls to a simple standard C function atoi, and has three implementations:</p>
|
|
218
224
|
<ul class="simple">
|
|
219
|
-
<li><p>the first one is the reference, it calls atoi through an N-API module, and is close to the theoretical limit of a perfect (no overhead) Node.js > C FFI implementation
|
|
225
|
+
<li><p>the first one is the reference, it calls atoi through an N-API module, and is close to the theoretical limit of a perfect (no overhead) Node.js > C FFI implementation (pre-compiled static glue code)</p></li>
|
|
220
226
|
<li><p>the second one calls atoi through Koffi</p></li>
|
|
221
227
|
<li><p>the third one uses the official Node.js FFI implementation, node-ffi-napi</p></li>
|
|
222
228
|
</ul>
|
|
@@ -230,6 +236,7 @@
|
|
|
230
236
|
<tr class="row-odd"><th class="head"><p>Benchmark</p></th>
|
|
231
237
|
<th class="head"><p>Iterations</p></th>
|
|
232
238
|
<th class="head"><p>Total time</p></th>
|
|
239
|
+
<th class="head"><p>Relative performance</p></th>
|
|
233
240
|
<th class="head"><p>Overhead</p></th>
|
|
234
241
|
</tr>
|
|
235
242
|
</thead>
|
|
@@ -238,16 +245,19 @@
|
|
|
238
245
|
<td><p>20000000</p></td>
|
|
239
246
|
<td><p>1.44s</p></td>
|
|
240
247
|
<td><p>(baseline)</p></td>
|
|
248
|
+
<td><p>(baseline)</p></td>
|
|
241
249
|
</tr>
|
|
242
250
|
<tr class="row-odd"><td><p>rand_koffi</p></td>
|
|
243
251
|
<td><p>20000000</p></td>
|
|
244
252
|
<td><p>2.60s</p></td>
|
|
245
|
-
<td><p>
|
|
253
|
+
<td><p>x0.55</p></td>
|
|
254
|
+
<td><p>+81%</p></td>
|
|
246
255
|
</tr>
|
|
247
256
|
<tr class="row-even"><td><p>rand_node_ffi</p></td>
|
|
248
257
|
<td><p>20000000</p></td>
|
|
249
258
|
<td><p>107.58s</p></td>
|
|
250
|
-
<td><p>
|
|
259
|
+
<td><p>x0.01</p></td>
|
|
260
|
+
<td><p>+7400%</p></td>
|
|
251
261
|
</tr>
|
|
252
262
|
</tbody>
|
|
253
263
|
</table>
|
|
@@ -262,6 +272,7 @@
|
|
|
262
272
|
<tr class="row-odd"><th class="head"><p>Benchmark</p></th>
|
|
263
273
|
<th class="head"><p>Iterations</p></th>
|
|
264
274
|
<th class="head"><p>Total time</p></th>
|
|
275
|
+
<th class="head"><p>Relative performance</p></th>
|
|
265
276
|
<th class="head"><p>Overhead</p></th>
|
|
266
277
|
</tr>
|
|
267
278
|
</thead>
|
|
@@ -270,16 +281,19 @@
|
|
|
270
281
|
<td><p>20000000</p></td>
|
|
271
282
|
<td><p>2.10s</p></td>
|
|
272
283
|
<td><p>(baseline)</p></td>
|
|
284
|
+
<td><p>(baseline)</p></td>
|
|
273
285
|
</tr>
|
|
274
286
|
<tr class="row-odd"><td><p>rand_koffi</p></td>
|
|
275
287
|
<td><p>20000000</p></td>
|
|
276
288
|
<td><p>3.87s</p></td>
|
|
277
|
-
<td><p>
|
|
289
|
+
<td><p>x0.54</p></td>
|
|
290
|
+
<td><p>+84%</p></td>
|
|
278
291
|
</tr>
|
|
279
292
|
<tr class="row-even"><td><p>rand_node_ffi</p></td>
|
|
280
293
|
<td><p>20000000</p></td>
|
|
281
294
|
<td><p>87.84s</p></td>
|
|
282
|
-
<td><p>
|
|
295
|
+
<td><p>x0.02</p></td>
|
|
296
|
+
<td><p>+4100%</p></td>
|
|
283
297
|
</tr>
|
|
284
298
|
</tbody>
|
|
285
299
|
</table>
|
|
@@ -299,6 +313,7 @@
|
|
|
299
313
|
<tr class="row-odd"><th class="head"><p>Benchmark</p></th>
|
|
300
314
|
<th class="head"><p>Iterations</p></th>
|
|
301
315
|
<th class="head"><p>Total time</p></th>
|
|
316
|
+
<th class="head"><p>Relative performance</p></th>
|
|
302
317
|
<th class="head"><p>Overhead</p></th>
|
|
303
318
|
</tr>
|
|
304
319
|
</thead>
|
|
@@ -307,16 +322,19 @@
|
|
|
307
322
|
<td><p>20000000</p></td>
|
|
308
323
|
<td><p>2.97s</p></td>
|
|
309
324
|
<td><p>(baseline)</p></td>
|
|
325
|
+
<td><p>(baseline)</p></td>
|
|
310
326
|
</tr>
|
|
311
327
|
<tr class="row-odd"><td><p>atoi_koffi</p></td>
|
|
312
328
|
<td><p>20000000</p></td>
|
|
313
329
|
<td><p>5.07s</p></td>
|
|
314
|
-
<td><p>
|
|
330
|
+
<td><p>x0.58</p></td>
|
|
331
|
+
<td><p>+71%</p></td>
|
|
315
332
|
</tr>
|
|
316
333
|
<tr class="row-even"><td><p>atoi_node_ffi</p></td>
|
|
317
334
|
<td><p>20000000</p></td>
|
|
318
335
|
<td><p>693.16s</p></td>
|
|
319
|
-
<td><p>
|
|
336
|
+
<td><p>x0.005</p></td>
|
|
337
|
+
<td><p>+23000%</p></td>
|
|
320
338
|
</tr>
|
|
321
339
|
</tbody>
|
|
322
340
|
</table>
|
|
@@ -331,6 +349,7 @@
|
|
|
331
349
|
<tr class="row-odd"><th class="head"><p>Benchmark</p></th>
|
|
332
350
|
<th class="head"><p>Iterations</p></th>
|
|
333
351
|
<th class="head"><p>Total time</p></th>
|
|
352
|
+
<th class="head"><p>Relative performance</p></th>
|
|
334
353
|
<th class="head"><p>Overhead</p></th>
|
|
335
354
|
</tr>
|
|
336
355
|
</thead>
|
|
@@ -339,16 +358,19 @@
|
|
|
339
358
|
<td><p>20000000</p></td>
|
|
340
359
|
<td><p>2.97s</p></td>
|
|
341
360
|
<td><p>(baseline)</p></td>
|
|
361
|
+
<td><p>(baseline)</p></td>
|
|
342
362
|
</tr>
|
|
343
363
|
<tr class="row-odd"><td><p>atoi_koffi</p></td>
|
|
344
364
|
<td><p>20000000</p></td>
|
|
345
365
|
<td><p>5.91s</p></td>
|
|
346
|
-
<td><p>
|
|
366
|
+
<td><p>x0.50</p></td>
|
|
367
|
+
<td><p>+99%</p></td>
|
|
347
368
|
</tr>
|
|
348
369
|
<tr class="row-even"><td><p>atoi_node_ffi</p></td>
|
|
349
370
|
<td><p>20000000</p></td>
|
|
350
371
|
<td><p>479.34s</p></td>
|
|
351
|
-
<td><p>
|
|
372
|
+
<td><p>x0.006</p></td>
|
|
373
|
+
<td><p>+16000%</p></td>
|
|
352
374
|
</tr>
|
|
353
375
|
</tbody>
|
|
354
376
|
</table>
|
|
@@ -371,6 +393,7 @@
|
|
|
371
393
|
<tr class="row-odd"><th class="head"><p>Benchmark</p></th>
|
|
372
394
|
<th class="head"><p>Iterations</p></th>
|
|
373
395
|
<th class="head"><p>Total time</p></th>
|
|
396
|
+
<th class="head"><p>Relative performance</p></th>
|
|
374
397
|
<th class="head"><p>Overhead</p></th>
|
|
375
398
|
</tr>
|
|
376
399
|
</thead>
|
|
@@ -378,22 +401,26 @@
|
|
|
378
401
|
<tr class="row-even"><td><p>raylib_cc</p></td>
|
|
379
402
|
<td><p>100</p></td>
|
|
380
403
|
<td><p>9.31s</p></td>
|
|
381
|
-
<td><p>
|
|
404
|
+
<td><p>x1.17</p></td>
|
|
405
|
+
<td><p>-15%</p></td>
|
|
382
406
|
</tr>
|
|
383
407
|
<tr class="row-odd"><td><p>raylib_node_raylib</p></td>
|
|
384
408
|
<td><p>100</p></td>
|
|
385
409
|
<td><p>10.90s</p></td>
|
|
386
|
-
<td><p>
|
|
410
|
+
<td><p>(baseline)</p></td>
|
|
411
|
+
<td><p>(baseline)</p></td>
|
|
387
412
|
</tr>
|
|
388
413
|
<tr class="row-even"><td><p>raylib_koffi</p></td>
|
|
389
414
|
<td><p>100</p></td>
|
|
390
415
|
<td><p>12.86s</p></td>
|
|
391
|
-
<td><p>
|
|
416
|
+
<td><p>x0.84</p></td>
|
|
417
|
+
<td><p>+18%</p></td>
|
|
392
418
|
</tr>
|
|
393
419
|
<tr class="row-odd"><td><p>raylib_node_ffi</p></td>
|
|
394
420
|
<td><p>100</p></td>
|
|
395
421
|
<td><p>35.76s</p></td>
|
|
396
|
-
<td><p>
|
|
422
|
+
<td><p>x0.30</p></td>
|
|
423
|
+
<td><p>+228%</p></td>
|
|
397
424
|
</tr>
|
|
398
425
|
</tbody>
|
|
399
426
|
</table>
|
|
@@ -408,6 +435,7 @@
|
|
|
408
435
|
<tr class="row-odd"><th class="head"><p>Benchmark</p></th>
|
|
409
436
|
<th class="head"><p>Iterations</p></th>
|
|
410
437
|
<th class="head"><p>Total time</p></th>
|
|
438
|
+
<th class="head"><p>Relative performance</p></th>
|
|
411
439
|
<th class="head"><p>Overhead</p></th>
|
|
412
440
|
</tr>
|
|
413
441
|
</thead>
|
|
@@ -415,22 +443,26 @@
|
|
|
415
443
|
<tr class="row-even"><td><p>raylib_cc</p></td>
|
|
416
444
|
<td><p>100</p></td>
|
|
417
445
|
<td><p>10.67s</p></td>
|
|
418
|
-
<td><p>
|
|
446
|
+
<td><p>x1.17</p></td>
|
|
447
|
+
<td><p>-12%</p></td>
|
|
419
448
|
</tr>
|
|
420
449
|
<tr class="row-odd"><td><p>raylib_node_raylib</p></td>
|
|
421
450
|
<td><p>100</p></td>
|
|
422
451
|
<td><p>12.05s</p></td>
|
|
423
|
-
<td><p>
|
|
452
|
+
<td><p>(baseline)</p></td>
|
|
453
|
+
<td><p>(baseline)</p></td>
|
|
424
454
|
</tr>
|
|
425
455
|
<tr class="row-even"><td><p>raylib_koffi</p></td>
|
|
426
456
|
<td><p>100</p></td>
|
|
427
457
|
<td><p>14.84s</p></td>
|
|
428
|
-
<td><p>
|
|
458
|
+
<td><p>x0.81</p></td>
|
|
459
|
+
<td><p>+23%</p></td>
|
|
429
460
|
</tr>
|
|
430
461
|
<tr class="row-odd"><td><p>raylib_node_ffi</p></td>
|
|
431
462
|
<td><p>100</p></td>
|
|
432
463
|
<td><p>44.63s</p></td>
|
|
433
|
-
<td><p>
|
|
464
|
+
<td><p>x0.27</p></td>
|
|
465
|
+
<td><p>+270%</p></td>
|
|
434
466
|
</tr>
|
|
435
467
|
</tbody>
|
|
436
468
|
</table>
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="en">
|
|
3
|
+
<head><meta charset="utf-8"/>
|
|
4
|
+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
5
|
+
<meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
|
6
|
+
<link rel="index" title="Index" href="genindex" /><link rel="search" title="Search" href="search" /><link rel="prev" title="Contributing" href="contribute" />
|
|
7
|
+
|
|
8
|
+
<meta name="generator" content="sphinx-5.0.1, furo 2022.06.04.1"/>
|
|
9
|
+
<title>Changelog - Koffi</title>
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=40978830699223671f4072448e654b5958f38b89" />
|
|
12
|
+
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
body {
|
|
20
|
+
--color-code-background: #f8f8f8;
|
|
21
|
+
--color-code-foreground: black;
|
|
22
|
+
--color-brand-primary: #FF6600;
|
|
23
|
+
--color-brand-content: #FF6600;
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
@media not print {
|
|
27
|
+
body[data-theme="dark"] {
|
|
28
|
+
--color-code-background: #202020;
|
|
29
|
+
--color-code-foreground: #d0d0d0;
|
|
30
|
+
--color-brand-primary: #FF6600;
|
|
31
|
+
--color-brand-content: #FF6600;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
@media (prefers-color-scheme: dark) {
|
|
35
|
+
body:not([data-theme="light"]) {
|
|
36
|
+
--color-code-background: #202020;
|
|
37
|
+
--color-code-foreground: #d0d0d0;
|
|
38
|
+
--color-brand-primary: #FF6600;
|
|
39
|
+
--color-brand-content: #FF6600;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</style></head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
53
|
+
<symbol id="svg-toc" viewBox="0 0 24 24">
|
|
54
|
+
<title>Contents</title>
|
|
55
|
+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
|
|
56
|
+
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
|
|
57
|
+
</svg>
|
|
58
|
+
</symbol>
|
|
59
|
+
<symbol id="svg-menu" viewBox="0 0 24 24">
|
|
60
|
+
<title>Menu</title>
|
|
61
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
62
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
|
|
63
|
+
<line x1="3" y1="12" x2="21" y2="12"></line>
|
|
64
|
+
<line x1="3" y1="6" x2="21" y2="6"></line>
|
|
65
|
+
<line x1="3" y1="18" x2="21" y2="18"></line>
|
|
66
|
+
</svg>
|
|
67
|
+
</symbol>
|
|
68
|
+
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
|
|
69
|
+
<title>Expand</title>
|
|
70
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
71
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
|
|
72
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
73
|
+
</svg>
|
|
74
|
+
</symbol>
|
|
75
|
+
<symbol id="svg-sun" viewBox="0 0 24 24">
|
|
76
|
+
<title>Light mode</title>
|
|
77
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
78
|
+
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
|
|
79
|
+
<circle cx="12" cy="12" r="5"></circle>
|
|
80
|
+
<line x1="12" y1="1" x2="12" y2="3"></line>
|
|
81
|
+
<line x1="12" y1="21" x2="12" y2="23"></line>
|
|
82
|
+
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
|
|
83
|
+
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
|
|
84
|
+
<line x1="1" y1="12" x2="3" y2="12"></line>
|
|
85
|
+
<line x1="21" y1="12" x2="23" y2="12"></line>
|
|
86
|
+
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
|
|
87
|
+
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
|
|
88
|
+
</svg>
|
|
89
|
+
</symbol>
|
|
90
|
+
<symbol id="svg-moon" viewBox="0 0 24 24">
|
|
91
|
+
<title>Dark mode</title>
|
|
92
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
93
|
+
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
|
|
94
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
95
|
+
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
|
|
96
|
+
</svg>
|
|
97
|
+
</symbol>
|
|
98
|
+
<symbol id="svg-sun-half" viewBox="0 0 24 24">
|
|
99
|
+
<title>Auto light/dark mode</title>
|
|
100
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
101
|
+
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
|
|
102
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
|
103
|
+
<circle cx="12" cy="12" r="9" />
|
|
104
|
+
<path d="M13 12h5" />
|
|
105
|
+
<path d="M13 15h4" />
|
|
106
|
+
<path d="M13 18h1" />
|
|
107
|
+
<path d="M13 9h4" />
|
|
108
|
+
<path d="M13 6h1" />
|
|
109
|
+
</svg>
|
|
110
|
+
</symbol>
|
|
111
|
+
</svg>
|
|
112
|
+
|
|
113
|
+
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
|
|
114
|
+
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
|
|
115
|
+
<label class="overlay sidebar-overlay" for="__navigation">
|
|
116
|
+
<div class="visually-hidden">Hide navigation sidebar</div>
|
|
117
|
+
</label>
|
|
118
|
+
<label class="overlay toc-overlay" for="__toc">
|
|
119
|
+
<div class="visually-hidden">Hide table of contents sidebar</div>
|
|
120
|
+
</label>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<div class="page">
|
|
125
|
+
<header class="mobile-header">
|
|
126
|
+
<div class="header-left">
|
|
127
|
+
<label class="nav-overlay-icon" for="__navigation">
|
|
128
|
+
<div class="visually-hidden">Toggle site navigation sidebar</div>
|
|
129
|
+
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
|
|
130
|
+
</label>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="header-center">
|
|
133
|
+
<a href="index"><div class="brand">Koffi</div></a>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="header-right">
|
|
136
|
+
<div class="theme-toggle-container theme-toggle-header">
|
|
137
|
+
<button class="theme-toggle">
|
|
138
|
+
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|
139
|
+
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
|
|
140
|
+
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|
141
|
+
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
|
142
|
+
</button>
|
|
143
|
+
</div>
|
|
144
|
+
<label class="toc-overlay-icon toc-header-icon" for="__toc">
|
|
145
|
+
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|
146
|
+
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|
147
|
+
</label>
|
|
148
|
+
</div>
|
|
149
|
+
</header>
|
|
150
|
+
<aside class="sidebar-drawer">
|
|
151
|
+
<div class="sidebar-container">
|
|
152
|
+
|
|
153
|
+
<div class="sidebar-sticky"><a class="sidebar-brand" href="index">
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
<span class="sidebar-brand-text">Koffi</span>
|
|
157
|
+
|
|
158
|
+
</a><form class="sidebar-search-container" method="get" action="search" role="search">
|
|
159
|
+
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
|
|
160
|
+
<input type="hidden" name="check_keywords" value="yes">
|
|
161
|
+
<input type="hidden" name="area" value="default">
|
|
162
|
+
</form>
|
|
163
|
+
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
|
|
164
|
+
<ul class="current">
|
|
165
|
+
<li class="toctree-l1"><a class="reference internal" href="platforms">Supported platforms</a></li>
|
|
166
|
+
<li class="toctree-l1"><a class="reference internal" href="start">Quick start</a></li>
|
|
167
|
+
<li class="toctree-l1"><a class="reference internal" href="types">Data types</a></li>
|
|
168
|
+
<li class="toctree-l1"><a class="reference internal" href="functions">Function calls</a></li>
|
|
169
|
+
<li class="toctree-l1"><a class="reference internal" href="memory">Memory usage</a></li>
|
|
170
|
+
<li class="toctree-l1"><a class="reference internal" href="benchmarks">Benchmarks</a></li>
|
|
171
|
+
<li class="toctree-l1"><a class="reference internal" href="contribute">Contributing</a></li>
|
|
172
|
+
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Changelog</a></li>
|
|
173
|
+
</ul>
|
|
174
|
+
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
</div>
|
|
181
|
+
</aside>
|
|
182
|
+
<div class="main">
|
|
183
|
+
<div class="content">
|
|
184
|
+
<div class="article-container">
|
|
185
|
+
<a href="#" class="back-to-top muted-link">
|
|
186
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
187
|
+
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
|
|
188
|
+
</svg>
|
|
189
|
+
<span>Back to top</span>
|
|
190
|
+
</a>
|
|
191
|
+
<div class="content-icon-container">
|
|
192
|
+
<div class="theme-toggle-container theme-toggle-content">
|
|
193
|
+
<button class="theme-toggle">
|
|
194
|
+
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
|
|
195
|
+
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
|
|
196
|
+
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
|
|
197
|
+
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
|
|
198
|
+
</button>
|
|
199
|
+
</div>
|
|
200
|
+
<label class="toc-overlay-icon toc-content-icon" for="__toc">
|
|
201
|
+
<div class="visually-hidden">Toggle table of contents sidebar</div>
|
|
202
|
+
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
|
203
|
+
</label>
|
|
204
|
+
</div>
|
|
205
|
+
<article role="main">
|
|
206
|
+
<section id="changelog">
|
|
207
|
+
<h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this heading">#</a></h1>
|
|
208
|
+
<section id="koffi-1-3-3">
|
|
209
|
+
<h2>Koffi 1.3.3<a class="headerlink" href="#koffi-1-3-3" title="Permalink to this heading">#</a></h2>
|
|
210
|
+
<p><strong>Main fixes:</strong></p>
|
|
211
|
+
<ul class="simple">
|
|
212
|
+
<li><p>Fix misconversion of signed integer return value as unsigned</p></li>
|
|
213
|
+
</ul>
|
|
214
|
+
<p><strong>Other changes:</strong></p>
|
|
215
|
+
<ul class="simple">
|
|
216
|
+
<li><p>Support <code class="docutils literal notranslate"><span class="pre">(void)</span></code> (empty) function signatures</p></li>
|
|
217
|
+
<li><p>Disable unsafe compiler optimizations</p></li>
|
|
218
|
+
<li><p>Various documentation improvements</p></li>
|
|
219
|
+
</ul>
|
|
220
|
+
</section>
|
|
221
|
+
<section id="koffi-1-3-2">
|
|
222
|
+
<h2>Koffi 1.3.2<a class="headerlink" href="#koffi-1-3-2" title="Permalink to this heading">#</a></h2>
|
|
223
|
+
<p><strong>Main fixes:</strong></p>
|
|
224
|
+
<ul class="simple">
|
|
225
|
+
<li><p>Support compilation in C++14 mode (graceful degradation)</p></li>
|
|
226
|
+
<li><p>Support older toolchains on Linux (tested on Debian 9)</p></li>
|
|
227
|
+
</ul>
|
|
228
|
+
</section>
|
|
229
|
+
<section id="koffi-1-3-1">
|
|
230
|
+
<h2>Koffi 1.3.1<a class="headerlink" href="#koffi-1-3-1" title="Permalink to this heading">#</a></h2>
|
|
231
|
+
<p><strong>Main fixes:</strong></p>
|
|
232
|
+
<ul class="simple">
|
|
233
|
+
<li><p>The prebuilt binary is tested when Koffi is installed, and a rebuild happens if it fails to load</p></li>
|
|
234
|
+
</ul>
|
|
235
|
+
</section>
|
|
236
|
+
<section id="koffi-1-3-0">
|
|
237
|
+
<h2>Koffi 1.3.0<a class="headerlink" href="#koffi-1-3-0" title="Permalink to this heading">#</a></h2>
|
|
238
|
+
<p><strong>Major changes:</strong></p>
|
|
239
|
+
<ul class="simple">
|
|
240
|
+
<li><p>Expand and move documentation to <a class="reference external" href="https://koffi.dev/">https://koffi.dev/</a></p></li>
|
|
241
|
+
<li><p>Support JS arrays and TypedArrays for pointer arguments (input, output and mixed)</p></li>
|
|
242
|
+
</ul>
|
|
243
|
+
<p><strong>Other changes:</strong></p>
|
|
244
|
+
<ul class="simple">
|
|
245
|
+
<li><p>Convert NULL string pointers to null instead of crashing (return values, struct and array members, callbacks)</p></li>
|
|
246
|
+
<li><p>Default to ‘string’ array hint for char, char16 and char16_t arrays</p></li>
|
|
247
|
+
<li><p>Fix definition of long types on Windows x64 (LLP64 model)</p></li>
|
|
248
|
+
<li><p>Restrict automatic string conversion to signed char types</p></li>
|
|
249
|
+
<li><p>Detect floating-point ABI before using prebuilt binaries (ARM32, RISC-V)</p></li>
|
|
250
|
+
<li><p>Forbid duplicate member names in struct types</p></li>
|
|
251
|
+
</ul>
|
|
252
|
+
</section>
|
|
253
|
+
<section id="koffi-1-2-4">
|
|
254
|
+
<h2>Koffi 1.2.4<a class="headerlink" href="#koffi-1-2-4" title="Permalink to this heading">#</a></h2>
|
|
255
|
+
<p><strong>New features:</strong></p>
|
|
256
|
+
<ul class="simple">
|
|
257
|
+
<li><p>Windows ARM64 is now supported</p></li>
|
|
258
|
+
</ul>
|
|
259
|
+
</section>
|
|
260
|
+
<section id="koffi-1-2-3">
|
|
261
|
+
<h2>Koffi 1.2.3<a class="headerlink" href="#koffi-1-2-3" title="Permalink to this heading">#</a></h2>
|
|
262
|
+
<p><strong>New features:</strong></p>
|
|
263
|
+
<ul class="simple">
|
|
264
|
+
<li><p>A prebuilt binary for macOS ARM64 (M1) is now included</p></li>
|
|
265
|
+
</ul>
|
|
266
|
+
</section>
|
|
267
|
+
<section id="koffi-1-2-1">
|
|
268
|
+
<h2>Koffi 1.2.1<a class="headerlink" href="#koffi-1-2-1" title="Permalink to this heading">#</a></h2>
|
|
269
|
+
<p>This entry documents changes since version 1.1.0.</p>
|
|
270
|
+
<p><strong>New features:</strong></p>
|
|
271
|
+
<ul class="simple">
|
|
272
|
+
<li><p>JS functions can be used as C callbacks (cdecl, stdcall) on all platforms</p></li>
|
|
273
|
+
<li><p>RISC-V 64 LP64D ABI is supported (LP64 is untested)</p></li>
|
|
274
|
+
<li><p>Expose settings for memory usage of synchronous and asynchronous calls</p></li>
|
|
275
|
+
<li><p>Transparent conversion between C buffers and strings</p></li>
|
|
276
|
+
<li><p>Tentative support for Windows ARM64 (untested)</p></li>
|
|
277
|
+
</ul>
|
|
278
|
+
<p><strong>Main fixes:</strong></p>
|
|
279
|
+
<ul class="simple">
|
|
280
|
+
<li><p>Fix excessive stack alignment of structs on x86 platforms</p></li>
|
|
281
|
+
<li><p>Fix potential problems with big int64_t/uint64_t values</p></li>
|
|
282
|
+
<li><p>Fix possible struct layout errors in push/pop code</p></li>
|
|
283
|
+
<li><p>Fix alignment issues in ARM32 push code</p></li>
|
|
284
|
+
<li><p>Fix incomplete/buggy support for HFA structs on ARM32 and ARM64</p></li>
|
|
285
|
+
<li><p>Fix crashes on OpenBSD caused by missing MAP_STACK flag</p></li>
|
|
286
|
+
<li><p>Fix non-sense “duplicate array type” errors</p></li>
|
|
287
|
+
<li><p>Fix value <code class="docutils literal notranslate"><span class="pre">koffi.internal</span></code> to false in module (normal) builds</p></li>
|
|
288
|
+
<li><p>Make sure we have a redzone below the stack for all architectures</p></li>
|
|
289
|
+
<li><p>Use slower allocation for big objects instead of failing</p></li>
|
|
290
|
+
</ul>
|
|
291
|
+
</section>
|
|
292
|
+
</section>
|
|
293
|
+
|
|
294
|
+
</article>
|
|
295
|
+
</div>
|
|
296
|
+
<footer>
|
|
297
|
+
|
|
298
|
+
<div class="related-pages">
|
|
299
|
+
|
|
300
|
+
<a class="prev-page" href="contribute">
|
|
301
|
+
<svg><use href="#svg-arrow-right"></use></svg>
|
|
302
|
+
<div class="page-info">
|
|
303
|
+
<div class="context">
|
|
304
|
+
<span>Previous</span>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<div class="title">Contributing</div>
|
|
308
|
+
|
|
309
|
+
</div>
|
|
310
|
+
</a>
|
|
311
|
+
</div>
|
|
312
|
+
<div class="bottom-of-page">
|
|
313
|
+
<div class="left-details">
|
|
314
|
+
<div class="copyright">
|
|
315
|
+
Copyright © 2022, Niels Martignène
|
|
316
|
+
</div>
|
|
317
|
+
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
|
|
318
|
+
|
|
319
|
+
<a href="https://github.com/pradyunsg/furo">Furo</a>
|
|
320
|
+
|
|
321
|
+
</div>
|
|
322
|
+
<div class="right-details">
|
|
323
|
+
<div class="icons">
|
|
324
|
+
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</div>
|
|
328
|
+
|
|
329
|
+
</footer>
|
|
330
|
+
</div>
|
|
331
|
+
<aside class="toc-drawer">
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
<div class="toc-sticky toc-scroll">
|
|
335
|
+
<div class="toc-title-container">
|
|
336
|
+
<span class="toc-title">
|
|
337
|
+
Contents
|
|
338
|
+
</span>
|
|
339
|
+
</div>
|
|
340
|
+
<div class="toc-tree-container">
|
|
341
|
+
<div class="toc-tree">
|
|
342
|
+
<ul>
|
|
343
|
+
<li><a class="reference internal" href="#">Changelog</a><ul>
|
|
344
|
+
<li><a class="reference internal" href="#koffi-1-3-3">Koffi 1.3.3</a></li>
|
|
345
|
+
<li><a class="reference internal" href="#koffi-1-3-2">Koffi 1.3.2</a></li>
|
|
346
|
+
<li><a class="reference internal" href="#koffi-1-3-1">Koffi 1.3.1</a></li>
|
|
347
|
+
<li><a class="reference internal" href="#koffi-1-3-0">Koffi 1.3.0</a></li>
|
|
348
|
+
<li><a class="reference internal" href="#koffi-1-2-4">Koffi 1.2.4</a></li>
|
|
349
|
+
<li><a class="reference internal" href="#koffi-1-2-3">Koffi 1.2.3</a></li>
|
|
350
|
+
<li><a class="reference internal" href="#koffi-1-2-1">Koffi 1.2.1</a></li>
|
|
351
|
+
</ul>
|
|
352
|
+
</li>
|
|
353
|
+
</ul>
|
|
354
|
+
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
</aside>
|
|
361
|
+
</div>
|
|
362
|
+
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
|
363
|
+
<script src="_static/jquery.js"></script>
|
|
364
|
+
<script src="_static/underscore.js"></script>
|
|
365
|
+
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
|
366
|
+
<script src="_static/doctools.js"></script>
|
|
367
|
+
<script src="_static/scripts/furo.js"></script>
|
|
368
|
+
</body>
|
|
369
|
+
</html>
|