koffi 1.3.0 → 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.
Files changed (94) hide show
  1. package/CMakeLists.txt +32 -4
  2. package/ChangeLog.md +79 -0
  3. package/build/qemu/1.3.3/koffi_darwin_arm64.tar.gz +0 -0
  4. package/build/qemu/1.3.3/koffi_darwin_x64.tar.gz +0 -0
  5. package/build/qemu/1.3.3/koffi_freebsd_arm64.tar.gz +0 -0
  6. package/build/qemu/1.3.3/koffi_freebsd_ia32.tar.gz +0 -0
  7. package/build/qemu/1.3.3/koffi_freebsd_x64.tar.gz +0 -0
  8. package/build/qemu/1.3.3/koffi_linux_arm32hf.tar.gz +0 -0
  9. package/build/qemu/1.3.3/koffi_linux_arm64.tar.gz +0 -0
  10. package/build/qemu/1.3.3/koffi_linux_ia32.tar.gz +0 -0
  11. package/build/qemu/1.3.3/koffi_linux_riscv64hf64.tar.gz +0 -0
  12. package/build/qemu/1.3.3/koffi_linux_x64.tar.gz +0 -0
  13. package/build/qemu/1.3.3/koffi_openbsd_ia32.tar.gz +0 -0
  14. package/build/qemu/1.3.3/koffi_openbsd_x64.tar.gz +0 -0
  15. package/build/qemu/1.3.3/koffi_win32_arm64.tar.gz +0 -0
  16. package/build/qemu/1.3.3/koffi_win32_ia32.tar.gz +0 -0
  17. package/build/qemu/1.3.3/koffi_win32_x64.tar.gz +0 -0
  18. package/doc/_static/perf_linux_20220623.png +0 -0
  19. package/doc/_static/perf_linux_20220623_2.png +0 -0
  20. package/doc/_static/perf_windows_20220623.png +0 -0
  21. package/doc/_static/perf_windows_20220623_2.png +0 -0
  22. package/doc/benchmarks.md +40 -36
  23. package/doc/benchmarks.xlsx +0 -0
  24. package/doc/changes.md +2 -0
  25. package/doc/conf.py +10 -3
  26. package/doc/contribute.md +16 -0
  27. package/doc/dist/doctrees/benchmarks.doctree +0 -0
  28. package/doc/dist/doctrees/changes.doctree +0 -0
  29. package/doc/dist/doctrees/contribute.doctree +0 -0
  30. package/doc/dist/doctrees/environment.pickle +0 -0
  31. package/doc/dist/doctrees/functions.doctree +0 -0
  32. package/doc/dist/doctrees/index.doctree +0 -0
  33. package/doc/dist/doctrees/platforms.doctree +0 -0
  34. package/doc/dist/html/_sources/benchmarks.md.txt +40 -36
  35. package/doc/dist/html/_sources/changes.md.txt +2 -0
  36. package/doc/dist/html/_sources/contribute.md.txt +16 -0
  37. package/doc/dist/html/_sources/functions.md.txt +2 -0
  38. package/doc/dist/html/_sources/index.rst.txt +2 -1
  39. package/doc/dist/html/_sources/platforms.md.txt +2 -0
  40. package/doc/dist/html/_static/perf_linux_20220623.png +0 -0
  41. package/doc/dist/html/_static/perf_linux_20220623_2.png +0 -0
  42. package/doc/dist/html/_static/perf_windows_20220623.png +0 -0
  43. package/doc/dist/html/_static/perf_windows_20220623_2.png +0 -0
  44. package/doc/dist/html/benchmarks.html +52 -20
  45. package/doc/dist/html/changes.html +369 -0
  46. package/doc/dist/html/contribute.html +24 -2
  47. package/doc/dist/html/functions.html +2 -0
  48. package/doc/dist/html/genindex.html +1 -0
  49. package/doc/dist/html/index.html +15 -3
  50. package/doc/dist/html/memory.html +1 -0
  51. package/doc/dist/html/objects.inv +0 -0
  52. package/doc/dist/html/platforms.html +3 -1
  53. package/doc/dist/html/search.html +1 -0
  54. package/doc/dist/html/searchindex.js +1 -1
  55. package/doc/dist/html/start.html +1 -0
  56. package/doc/dist/html/types.html +1 -0
  57. package/doc/functions.md +2 -0
  58. package/doc/index.rst +2 -1
  59. package/doc/platforms.md +2 -0
  60. package/package.json +4 -3
  61. package/qemu/qemu.js +2 -1
  62. package/src/abi_arm32.cc +9 -9
  63. package/src/abi_arm64.cc +9 -9
  64. package/src/abi_riscv64.cc +9 -9
  65. package/src/abi_x64_sysv.cc +9 -9
  66. package/src/abi_x64_sysv_fwd.S +14 -4
  67. package/src/abi_x64_win.cc +9 -9
  68. package/src/abi_x86.cc +9 -9
  69. package/src/abi_x86_fwd.S +6 -4
  70. package/src/call.cc +10 -10
  71. package/src/call.hh +6 -0
  72. package/src/ffi.cc +3 -1
  73. package/src/parser.cc +1 -1
  74. package/src/util.hh +21 -1
  75. package/test/CMakeLists.txt +1 -1
  76. package/test/misc.c +20 -0
  77. package/test/sync.js +13 -3
  78. package/vendor/libcc/libcc.cc +17 -5
  79. package/vendor/libcc/libcc.hh +33 -1
  80. package/build/qemu/1.3.0/koffi_darwin_arm64.tar.gz +0 -0
  81. package/build/qemu/1.3.0/koffi_darwin_x64.tar.gz +0 -0
  82. package/build/qemu/1.3.0/koffi_freebsd_arm64.tar.gz +0 -0
  83. package/build/qemu/1.3.0/koffi_freebsd_ia32.tar.gz +0 -0
  84. package/build/qemu/1.3.0/koffi_freebsd_x64.tar.gz +0 -0
  85. package/build/qemu/1.3.0/koffi_linux_arm32hf.tar.gz +0 -0
  86. package/build/qemu/1.3.0/koffi_linux_arm64.tar.gz +0 -0
  87. package/build/qemu/1.3.0/koffi_linux_ia32.tar.gz +0 -0
  88. package/build/qemu/1.3.0/koffi_linux_riscv64hf64.tar.gz +0 -0
  89. package/build/qemu/1.3.0/koffi_linux_x64.tar.gz +0 -0
  90. package/build/qemu/1.3.0/koffi_openbsd_ia32.tar.gz +0 -0
  91. package/build/qemu/1.3.0/koffi_openbsd_x64.tar.gz +0 -0
  92. package/build/qemu/1.3.0/koffi_win32_arm64.tar.gz +0 -0
  93. package/build/qemu/1.3.0/koffi_win32_ia32.tar.gz +0 -0
  94. package/build/qemu/1.3.0/koffi_win32_x64.tar.gz +0 -0
@@ -3,7 +3,7 @@
3
3
  <head><meta charset="utf-8"/>
4
4
  <meta name="viewport" content="width=device-width,initial-scale=1"/>
5
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="Benchmarks" href="benchmarks" />
6
+ <link rel="index" title="Index" href="genindex" /><link rel="search" title="Search" href="search" /><link rel="next" title="Changelog" href="changes" /><link rel="prev" title="Benchmarks" href="benchmarks" />
7
7
 
8
8
  <meta name="generator" content="sphinx-5.0.1, furo 2022.06.04.1"/>
9
9
  <title>Contributing - Koffi</title>
@@ -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"><a class="reference internal" href="benchmarks">Benchmarks</a></li>
171
171
  <li class="toctree-l1 current current-page"><a class="current reference internal" href="#">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>
@@ -212,6 +213,12 @@
212
213
  <section id="build-from-source">
213
214
  <h2>Build from source<a class="headerlink" href="#build-from-source" title="Permalink to this heading">#</a></h2>
214
215
  <p>We provide prebuilt binaries, packaged in the NPM archive, so in most cases it should be as simple as <code class="docutils literal notranslate"><span class="pre">npm</span> <span class="pre">install</span> <span class="pre">koffi</span></code>. If you want to hack Koffi or use a specific platform, follow the instructions below.</p>
216
+ <p>Start by cloning the repository with <a class="reference external" href="https://git-scm.com/">Git</a>:</p>
217
+ <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>git clone https://github.com/Koromix/luigi
218
+ <span class="nb">cd</span> luigi/koffi
219
+ </pre></div>
220
+ </div>
221
+ <p>As said before, this is a monorepository containg multiple projects, hence the name.</p>
215
222
  <section id="windows">
216
223
  <h3>Windows<a class="headerlink" href="#windows" title="Permalink to this heading">#</a></h3>
217
224
  <p>First, make sure the following dependencies are met:</p>
@@ -299,8 +306,14 @@ node qemu.js stop
299
306
  <li><p>Add support for unions</p></li>
300
307
  <li><p>Provide better ways to automatically deal with caller/heap-allocated memory (strings, etc.)</p></li>
301
308
  <li><p>Port Koffi to PowerPC (POWER9+) ABI</p></li>
309
+ <li><p>Fix assembly unwind and CFI directives for better debugging experience</p></li>
302
310
  </ul>
303
311
  </section>
312
+ <section id="code-style">
313
+ <h2>Code style<a class="headerlink" href="#code-style" title="Permalink to this heading">#</a></h2>
314
+ <p>Koffi is programmed in a mix of C++ and assembly code (architecture-specific code). It uses <a class="reference external" href="https://github.com/nodejs/node-addon-api">node-addon-api</a> (C++ N-API wrapper) to interact with Node.js.</p>
315
+ <p>My personal preference goes to a rather C-like C++ style, with careful use of templates (mainly for containers) and little object-oriented programming. I strongly prefer tagged unions and code locality over inheritance and virtual methods. Exceptions are disabled.</p>
316
+ </section>
304
317
  </section>
305
318
 
306
319
  </article>
@@ -308,7 +321,15 @@ node qemu.js stop
308
321
  <footer>
309
322
 
310
323
  <div class="related-pages">
311
-
324
+ <a class="next-page" href="changes">
325
+ <div class="page-info">
326
+ <div class="context">
327
+ <span>Next</span>
328
+ </div>
329
+ <div class="title">Changelog</div>
330
+ </div>
331
+ <svg><use href="#svg-arrow-right"></use></svg>
332
+ </a>
312
333
  <a class="prev-page" href="benchmarks">
313
334
  <svg><use href="#svg-arrow-right"></use></svg>
314
335
  <div class="page-info">
@@ -361,6 +382,7 @@ node qemu.js stop
361
382
  </li>
362
383
  <li><a class="reference internal" href="#running-tests">Running tests</a></li>
363
384
  <li><a class="reference internal" href="#todo-list">Todo list</a></li>
385
+ <li><a class="reference internal" href="#code-style">Code style</a></li>
364
386
  </ul>
365
387
  </li>
366
388
  </ul>
@@ -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"><a class="reference internal" href="benchmarks">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>
@@ -298,6 +299,7 @@
298
299
  <span class="linenos">11</span><span class="c1">// This program will print &quot;Hello World!&quot;, and then &quot;Result: 1257&quot;</span>
299
300
  </pre></div>
300
301
  </div>
302
+ <p>These calls are executed by worker threads. It is <strong>your responsibility to deal with data sharing issues</strong> in the native code that may be caused by multi-threading.</p>
301
303
  <p>You can easily convert this callback-style async function to a promise-based version with <code class="docutils literal notranslate"><span class="pre">util.promisify()</span></code> from the Node.js standard library.</p>
302
304
  <p>Variadic functions cannot be called asynchronously.</p>
303
305
  </section>
@@ -167,6 +167,7 @@
167
167
  <li class="toctree-l1"><a class="reference internal" href="memory">Memory usage</a></li>
168
168
  <li class="toctree-l1"><a class="reference internal" href="benchmarks">Benchmarks</a></li>
169
169
  <li class="toctree-l1"><a class="reference internal" href="contribute">Contributing</a></li>
170
+ <li class="toctree-l1"><a class="reference internal" href="changes">Changelog</a></li>
170
171
  </ul>
171
172
 
172
173
  </div>
@@ -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"><a class="reference internal" href="benchmarks">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>
@@ -203,12 +204,12 @@
203
204
  </div>
204
205
  <article role="main">
205
206
  <section id="koffi-version">
206
- <h1>Koffi 1.3.0<a class="headerlink" href="#koffi-version" title="Permalink to this heading">#</a></h1>
207
+ <h1>Koffi 1.3.2<a class="headerlink" href="#koffi-version" title="Permalink to this heading">#</a></h1>
207
208
  <section id="overview">
208
209
  <h2>Overview<a class="headerlink" href="#overview" title="Permalink to this heading">#</a></h2>
209
210
  <p>Koffi is a <strong>fast and easy-to-use C FFI module for Node.js</strong>, featuring:</p>
210
211
  <ul class="simple">
211
- <li><p>Low-overhead and fast performance (see <a class="reference internal" href="benchmarks#benchmarks"><span class="std std-ref">Benchmarks</span></a>)</p></li>
212
+ <li><p>Low-overhead and fast performance (see <a class="reference internal" href="benchmarks#benchmarks"><span class="std std-ref">benchmarks</span></a>)</p></li>
212
213
  <li><p>Support for primitive and aggregate data types (structs and fixed-size arrays), both by reference (pointer) and by value</p></li>
213
214
  <li><p>Javascript functions can be used as C callbacks (since 1.2.0)</p></li>
214
215
  <li><p>Well-tested code base for <a class="reference internal" href="platforms#supported-platforms"><span class="std std-ref">popular OS/architecture combinations</span></a></p></li>
@@ -258,6 +259,17 @@
258
259
  <li class="toctree-l2"><a class="reference internal" href="contribute#build-from-source">Build from source</a></li>
259
260
  <li class="toctree-l2"><a class="reference internal" href="contribute#running-tests">Running tests</a></li>
260
261
  <li class="toctree-l2"><a class="reference internal" href="contribute#todo-list">Todo list</a></li>
262
+ <li class="toctree-l2"><a class="reference internal" href="contribute#code-style">Code style</a></li>
263
+ </ul>
264
+ </li>
265
+ <li class="toctree-l1"><a class="reference internal" href="changes">Changelog</a><ul>
266
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-3-3">Koffi 1.3.3</a></li>
267
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-3-2">Koffi 1.3.2</a></li>
268
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-3-1">Koffi 1.3.1</a></li>
269
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-3-0">Koffi 1.3.0</a></li>
270
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-2-4">Koffi 1.2.4</a></li>
271
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-2-3">Koffi 1.2.3</a></li>
272
+ <li class="toctree-l2"><a class="reference internal" href="changes#koffi-1-2-1">Koffi 1.2.1</a></li>
261
273
  </ul>
262
274
  </li>
263
275
  </ul>
@@ -317,7 +329,7 @@
317
329
  <div class="toc-tree-container">
318
330
  <div class="toc-tree">
319
331
  <ul>
320
- <li><a class="reference internal" href="#">Koffi 1.3.0</a><ul>
332
+ <li><a class="reference internal" href="#">Koffi 1.3.2</a><ul>
321
333
  <li><a class="reference internal" href="#overview">Overview</a></li>
322
334
  <li><a class="reference internal" href="#table-of-contents">Table of contents</a></li>
323
335
  <li><a class="reference internal" href="#license">License</a></li>
@@ -169,6 +169,7 @@
169
169
  <li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Memory usage</a></li>
170
170
  <li class="toctree-l1"><a class="reference internal" href="benchmarks">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>
Binary file
@@ -3,7 +3,7 @@
3
3
  <head><meta charset="utf-8"/>
4
4
  <meta name="viewport" content="width=device-width,initial-scale=1"/>
5
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="next" title="Quick start" href="start" /><link rel="prev" title="Koffi 1.3.0" href="index" />
6
+ <link rel="index" title="Index" href="genindex" /><link rel="search" title="Search" href="search" /><link rel="next" title="Quick start" href="start" /><link rel="prev" title="Koffi 1.3.2" href="index" />
7
7
 
8
8
  <meta name="generator" content="sphinx-5.0.1, furo 2022.06.04.1"/>
9
9
  <title>Supported platforms - Koffi</title>
@@ -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"><a class="reference internal" href="benchmarks">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>
@@ -256,6 +257,7 @@
256
257
  </table>
257
258
  </div>
258
259
  <p>For all fully supported platforms (green check marks), a prebuilt binary is included in the NPM package which means you can install Koffi without a C++ compiler.</p>
260
+ <p>Node 12 or later is required, earlier versions are not supported. Use <a class="reference external" href="https://github.com/nvm-sh/nvm">NVM</a> to install recent Node versions on older Linux distributions.</p>
259
261
  <hr class="footnotes docutils" />
260
262
  <aside class="footnote brackets" id="id4" role="note">
261
263
  <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">1</a><span class="fn-bracket">]</span></span>
@@ -166,6 +166,7 @@
166
166
  <li class="toctree-l1"><a class="reference internal" href="memory">Memory usage</a></li>
167
167
  <li class="toctree-l1"><a class="reference internal" href="benchmarks">Benchmarks</a></li>
168
168
  <li class="toctree-l1"><a class="reference internal" href="contribute">Contributing</a></li>
169
+ <li class="toctree-l1"><a class="reference internal" href="changes">Changelog</a></li>
169
170
  </ul>
170
171
 
171
172
  </div>
@@ -1 +1 @@
1
- Search.setIndex({"docnames": ["benchmarks", "contribute", "functions", "index", "memory", "platforms", "start", "types"], "filenames": ["benchmarks.md", "contribute.md", "functions.md", "index.rst", "memory.md", "platforms.md", "start.md", "types.md"], "titles": ["Benchmarks", "Contributing", "Function calls", "Koffi 1.3.0", "Memory usage", "Supported platforms", "Quick start", "Data types"], "terms": {"here": [0, 1, 2, 3, 7], "quick": [0, 3], "overview": 0, "execut": 0, "time": [0, 1, 6], "koffi": [0, 1, 2, 4, 5, 6, 7], "call": [0, 3, 4, 5, 6, 7], "three": [0, 6, 7], "test": [0, 3, 5], "case": [0, 1, 2, 7], "one": [0, 2, 4, 6, 7], "base": [0, 2, 3, 7], "around": [0, 4, 7], "compar": 0, "theoret": 0, "ideal": 0, "implement": [0, 7], "These": [0, 1, 7], "ar": [0, 1, 2, 4, 5, 6, 7], "detail": 0, "explain": 0, "below": [0, 1, 2, 6, 7], "node": [0, 1, 2, 3, 6], "ffi": [0, 2, 3, 6], "napi": 0, "thi": [0, 1, 2, 3, 6, 7], "repeat": 0, "simpl": [0, 1, 2, 7], "standard": [0, 2, 7], "c": [0, 1, 3, 4, 5, 6], "function": [0, 1, 3, 6, 7], "ha": [0, 1, 2, 7], "first": [0, 1, 2, 6, 7], "refer": [0, 3, 7], "through": [0, 2, 7], "an": [0, 2, 4, 7], "n": [0, 5, 6, 7], "api": [0, 1, 2, 6, 7], "modul": [0, 3], "close": [0, 7], "limit": 0, "perfect": 0, "overhead": [0, 3], "js": [0, 1, 2, 3, 5, 7], "second": [0, 2, 6, 7], "third": [0, 7], "us": [0, 1, 3, 4, 5, 6, 7], "offici": [0, 1, 5], "becaus": [0, 1, 2, 7], "pretti": [0, 1], "small": [0, 2, 3], "clearli": 0, "visibl": 0, "The": [0, 1, 2, 4, 5, 6, 7], "were": 0, "measur": 0, "my": 0, "machin": [0, 1], "amd": 0, "ryzen": 0, "7": 0, "4700u": 0, "iter": [0, 7], "total": [0, 7], "rand_napi": 0, "20000000": 0, "1": [0, 1, 4, 5, 7], "44": 0, "baselin": 0, "rand_koffi": 0, "2": [0, 3, 4, 5, 7], "60": 0, "x1": 0, "81": [0, 1], "rand_node_ffi": 0, "107": 0, "58": 0, "x75": 0, "intel": 0, "core": 0, "i5": 0, "4460": 0, "10": 0, "3": [0, 1, 5, 7], "87": 0, "84": 0, "x42": 0, "similar": [0, 2], "which": [0, 1, 5, 6], "take": [0, 7], "string": [0, 1, 2, 4, 6], "paramet": [0, 3, 6, 7], "javascript": [0, 3, 7], "v8": [0, 2], "convers": [0, 7], "rel": 0, "slow": [0, 1], "heavi": 0, "atoi_napi": 0, "97": 0, "atoi_koffi": 0, "5": [0, 2, 7], "07": 0, "71": 0, "atoi_node_ffi": 0, "693": 0, "16": [0, 7], "x233": 0, "91": 0, "99": 0, "479": 0, "34": 0, "x161": 0, "cpu": 0, "imag": 0, "draw": 0, "much": [0, 1], "heavier": 0, "than": [0, 4], "thu": 0, "reduc": 0, "In": [0, 2, 7], "full": [0, 1, 7], "version": [0, 1, 2, 3, 7], "code": [0, 3, 4], "nativ": 0, "wrapper": 0, "raylib_cc": 0, "100": 0, "9": 0, "31": 0, "raylib_node_raylib": 0, "90": 0, "17": 0, "raylib_koffi": 0, "12": [0, 1], "86": 0, "38": 0, "raylib_node_ffi": 0, "35": 0, "76": 0, "x3": 0, "67": 0, "05": 0, "13": 0, "14": [0, 7], "39": 0, "63": 0, "x4": 0, "18": [0, 7], "open": [0, 2, 7], "consol": [0, 2, 4, 7], "go": [0, 1], "cnoke": [0, 1], "befor": [0, 7], "do": [0, 1, 7], "anyth": 0, "els": [0, 7], "cd": [0, 1], "onc": [0, 1, 2, 4, 6, 7], "done": [0, 1, 2, 7], "you": [0, 1, 2, 3, 5, 6, 7], "can": [0, 1, 2, 3, 4, 5, 6, 7], "each": [0, 1, 2, 7], "e": [0, 2, 7], "g": [0, 1, 2, 7], "build": [0, 3, 5, 7], "option": [0, 1, 2, 3, 7], "defin": [0, 7], "custom": 0, "number": [0, 4, 7], "10000000": 0, "repositori": 1, "name": [1, 2, 7], "luigi": 1, "monorepo": 1, "contain": [1, 7], "multipl": 1, "project": 1, "idea": 1, "http": [1, 3], "github": 1, "com": 1, "koromix": 1, "issu": [1, 2], "we": [1, 7], "provid": [1, 2, 7], "prebuilt": [1, 5], "binari": [1, 5], "packag": [1, 5], "npm": [1, 5, 6], "archiv": 1, "so": [1, 2, 6, 7], "most": [1, 2, 7], "should": 1, "instal": [1, 5, 6], "If": 1, "want": 1, "hack": 1, "specif": [1, 4], "follow": [1, 2, 5, 7], "instruct": [1, 2], "make": 1, "sure": 1, "depend": [1, 2, 7], "met": 1, "desktop": 1, "develop": 1, "workload": 1, "visual": 1, "studio": 1, "2022": 1, "2019": 1, "tool": 1, "default": [1, 2, 3, 7], "compon": 1, "cmake": 1, "meta": 1, "system": [1, 6], "later": [1, 3], "command": 1, "benchmark": [1, 3], "directori": [1, 7], "what": 1, "gcc": 1, "8": [1, 2, 7], "newer": 1, "gnu": [1, 3], "architectur": [1, 2, 3, 5, 7], "emul": 1, "acceler": 1, "when": [1, 2, 4, 7], "possibl": [1, 7], "qemu": 1, "need": [1, 2, 7], "even": 1, "gui": 1, "ubuntu": 1, "includ": [1, 2, 5, 7], "directli": [1, 7], "licens": 1, "size": [1, 3, 4], "reason": [1, 7], "thei": [1, 2, 7], "avail": [1, 4], "dev": 1, "file": [1, 2, 7], "For": [1, 2, 4, 5, 7], "exampl": [1, 3, 7], "debian": 1, "arm64": [1, 5], "wget": 1, "q": 1, "o": [1, 7], "qemu_debian_arm64": 1, "tar": 1, "zst": 1, "zstd": 1, "d": [1, 2, 7], "xv": 1, "sha256sum": 1, "ignor": [1, 2], "miss": 1, "registri": 1, "txt": 1, "note": [1, 7], "disk": 1, "content": [1, 7], "mai": 1, "chang": [1, 2, 4, 7], "checksum": 1, "fail": [1, 2, 7], "been": 1, "least": [1, 4], "And": [1, 6], "now": [1, 6, 7], "sever": [1, 2], "help": 1, "patient": 1, "linux": [1, 3, 5], "have": [1, 6, 7], "ccach": 1, "subsequ": [1, 4], "step": 1, "get": [1, 4, 6, 7], "more": [1, 2, 3, 4, 7], "toler": 1, "By": [1, 2, 7], "start": [1, 2, 3], "stop": 1, "But": [1, 7], "ahead": 1, "instead": [1, 7], "without": [1, 5], "shut": 1, "down": 1, "again": 1, "everyth": 1, "also": [1, 7], "restrict": 1, "subset": 1, "cycl": 1, "debian_x64": 1, "debian_i386": 1, "separ": 1, "shutdown": 1, "final": [1, 7], "join": 1, "ssh": 1, "shortcut": 1, "some": [1, 7], "debug": 1, "ani": [1, 3, 7], "manual": 1, "procedur": [1, 2], "configur": 1, "vnc": 1, "server": 1, "local": [1, 6], "access": 1, "displai": 1, "krdc": 1, "compat": 1, "viewer": 1, "info": 1, "port": 1, "after": [1, 2], "releas": 1, "0": [1, 2, 7], "current": [1, 6, 7], "prioriti": 1, "next": [1, 7], "major": 1, "autom": 1, "aarch64": [1, 5], "maco": [1, 5], "how": [1, 2, 3, 7], "creat": [1, 2, 7], "real": 1, "world": [1, 2, 6, 7], "librari": [1, 2, 6, 7], "raylib": [1, 3], "sqlite": [1, 2], "libsodium": 1, "illustr": [1, 6, 7], "work": [1, 3], "variou": 1, "style": [1, 2], "plan": 1, "eventu": 1, "necessarili": 1, "order": [1, 2], "optim": 1, "pass": [1, 2, 7], "struct": [1, 3, 4, 6], "arrai": [1, 3], "hfa": 1, "helper": 1, "add": [1, 7], "type": [1, 2, 3, 6], "parser": [1, 2], "wai": [1, 6, 7], "encod": [1, 7], "decod": 1, "byte": [1, 4, 7], "support": [1, 2, 3, 7], "union": 1, "better": 1, "automat": [1, 2], "deal": [1, 7], "caller": 1, "heap": [1, 4], "alloc": [1, 4, 7], "memori": [1, 2, 3, 7], "etc": [1, 2], "powerpc": 1, "power9": 1, "abi": [1, 5, 7], "To": 2, "declar": [2, 6, 7], "load": [2, 6, 7], "share": [2, 6, 7], "const": [2, 6, 7], "requir": [2, 6, 7], "lib": [2, 6, 7], "path": [2, 7], "extens": 2, "platform": [2, 3, 4, 7], "dll": [2, 6, 7], "dylib": 2, "return": [2, 7], "object": [2, 4, 7], "from": [2, 3, 5, 7], "two": [2, 4, 7], "inspir": 2, "specifi": [2, 7], "its": [2, 7], "non": [2, 7], "mangl": 2, "ellipsi": 2, "last": [2, 7], "printf": [2, 6], "func": [2, 6, 7], "int": [2, 6, 7], "atoi": [2, 3], "tri": 2, "x86": [2, 5, 6], "convent": [2, 5, 6], "see": [2, 3, 7], "section": [2, 7], "inform": [2, 3, 7], "subject": 2, "shown": 2, "char": [2, 6, 7], "fmt": 2, "happen": [2, 4, 7], "onli": [2, 5, 7], "per": 2, "process": 2, "32": 2, "bit": 2, "except": 2, "form": 2, "descript": [2, 4], "cdecl": [2, 5], "other": [2, 7], "stdcall": [2, 5, 6], "__stdcall": [2, 7], "within": 2, "win32": [2, 6, 7], "fastcal": [2, 5], "__fastcal": 2, "rare": [2, 7], "ecx": 2, "edx": 2, "thiscal": [2, 5], "__thiscal": 2, "safe": 2, "simpli": [2, 7], "find": [2, 3, 6, 7], "show": [2, 6, 7], "user32": [2, 6], "equival": [2, 7], "messageboxa_1": 2, "messageboxa": [2, 6], "void": [2, 6, 7], "uint": [2, 6, 7], "messageboxa_2": 2, "hwnd": 2, "text": 2, "caption": 2, "async": 2, "member": [2, 7], "argument": [2, 7], "err": 2, "re": 2, "libc": [2, 6], "6": [2, 6, 7], "str": [2, 7], "1257": 2, "log": [2, 4, 7], "result": [2, 3, 6, 7], "hello": [2, 6, 7], "program": [2, 3], "print": [2, 6, 7], "easili": 2, "convert": [2, 7], "promis": 2, "util": 2, "promisifi": 2, "cannot": [2, 7], "must": 2, "addit": [2, 7], "expect": [2, 5, 7], "valu": [2, 3, 6, 7], "doubl": [2, 5, 7], "THE": 2, "end": 2, "integ": [2, 7], "s": [2, 7], "On": 2, "forward": [2, 5], "howev": [2, 7], "mani": [2, 7], "pointer": [2, 3], "input": [2, 7], "simplici": 2, "semant": [2, 7], "primit": [2, 3], "marshal": 2, "out": [2, 7], "timev": [2, 6], "where": [2, 7], "inout": 2, "dual": 2, "same": [2, 4, 7], "msdn": 2, "qualifi": 2, "_out_": [2, 6, 7], "_inout_": [2, 7], "posix": 2, "gettimeofdai": [2, 6], "tv_sec": [2, 6], "unsign": [2, 6, 7], "tv_usec": [2, 6], "timezon": [2, 6], "tz_minuteswest": [2, 6], "tz_dsttime": [2, 6], "tv": [2, 6], "tz": [2, 6], "let": [2, 4, 6, 7], "null": [2, 6, 7], "databas": 2, "sqlite3_db": 2, "copi": [2, 7], "sqlite3_open_v2": 2, "sqlite_open_readwrit": 2, "0x2": 2, "sqlite_open_cr": 2, "0x4": 2, "db": 2, "throw": [2, 7], "new": [2, 4, 7], "error": [2, 7], "sqlite3_close_v2": 2, "With": 2, "noth": 2, "examplecallback": 2, "float": [2, 5, 7], "sum": [2, 7], "adddoublefloat": 2, "f": [2, 7], "your": [2, 3], "them": [2, 7], "part": 2, "h": [2, 7], "transfertoj": 2, "ag": 2, "cb": 2, "buf": 2, "64": [2, 5, 7], "snprintf": 2, "sizeof": [2, 7], "transfercallback": 2, "ret": 2, "niel": 2, "27": 2, "42": [2, 7], "main": 2, "precis": [2, 5], "intepret": 2, "anoth": [2, 7], "undefin": 2, "behavior": [2, 7], "lead": 2, "mess": [2, 7], "fast": 3, "easi": 3, "featur": 3, "low": 3, "perform": 3, "aggreg": 3, "data": 3, "fix": 3, "both": [3, 7], "callback": [3, 4, 5, 7], "sinc": 3, "well": 3, "popular": 3, "os": [3, 5, 7], "combin": [3, 5], "window": [3, 5], "introspect": 3, "definit": [3, 7], "synchron": [3, 4], "asynchron": [3, 4], "variad": [3, 6], "output": [3, 6, 7], "usag": 3, "set": 3, "rand": 3, "run": [3, 6], "contribut": 3, "bug": 3, "request": 3, "sourc": [3, 5], "todo": 3, "list": [3, 7], "free": [3, 7], "softwar": 3, "redistribut": 3, "modifi": [3, 7], "under": 3, "term": 3, "affero": 3, "gener": [3, 7], "public": 3, "publish": 3, "foundat": 3, "either": [3, 7], "www": 3, "org": 3, "normal": [4, 7], "prealloc": 4, "block": 4, "One": 4, "construct": 4, "assign": [4, 7], "stack": 4, "assembl": 4, "mib": 4, "big": [4, 7], "unless": 4, "veri": 4, "page": 4, "extra": 4, "ever": 4, "dure": 4, "config": 4, "obj": 4, "appli": [4, 7], "true": [4, 7], "made": 4, "unus": 4, "resid": 4, "still": 4, "finish": 4, "freed": 4, "resident_async_pool": 4, "left": 4, "sync_stack_s": 4, "sync_heap_s": 4, "async_stack_s": 4, "512": 4, "kib": 4, "async_heap_s": 4, "pool": 4, "moment": 5, "isa": 5, "freebsd": 5, "openbsd": 5, "ia32": 5, "ye": 5, "A": [5, 7], "x86_64": 5, "amd64": 5, "arm32": 5, "le": [5, 7], "probabl": 5, "risc": 5, "v": 5, "all": [5, 7], "fulli": 5, "green": 5, "check": 5, "mark": 5, "mean": [5, 7], "compil": 5, "ms": 5, "hard": 5, "vfp": 5, "coprocessor": 5, "differ": [5, 7], "softfp": 5, "soft": 5, "lp64d": 5, "lp64": [5, 7], "theori": 5, "untest": 5, "lp64f": 5, "like": [6, 7], "prototyp": 6, "languag": 6, "syntax": 6, "It": [6, 7], "time_t": 6, "int64_t": [6, 7], "tm": 6, "tm_sec": 6, "tm_min": 6, "tm_hour": 6, "tm_mdai": 6, "tm_mon": 6, "tm_year": 6, "tm_wdai": 6, "tm_ydai": 6, "tm_isdst": 6, "localtime_r": 6, "format": 6, "02d": 6, "target": 6, "messagebox": 6, "messag": 6, "user": [6, 7], "constant": 6, "mb_iconinform": 6, "0x40": 6, "foobar": 6, "while": 7, "allow": 7, "variat": 7, "enforc": 7, "signed": 7, "valid": 7, "int8": 7, "sign": 7, "int8_t": 7, "uint8": 7, "uint8_t": 7, "uchar": 7, "char16": 7, "char16_t": 7, "int16": 7, "int16_t": 7, "uint16": 7, "uint16_t": 7, "short": 7, "int32": 7, "4": 7, "int32_t": 7, "uint32": 7, "uint32_t": 7, "int64": 7, "uint64": 7, "uint64_t": 7, "longlong": 7, "long": 7, "ulonglong": 7, "float32": 7, "float64": 7, "few": 7, "boolean": 7, "bool": 7, "usual": 7, "llp64": 7, "ulong": 7, "utf": 7, "string16": 7, "line": 7, "struct1": 7, "dummi": 7, "struct2": 7, "vice": 7, "versa": 7, "unlik": 7, "omit": 7, "anonym": 7, "typedef": 7, "b": 7, "d1": 7, "d2": 7, "rule": 7, "regard": 7, "align": 7, "pad": 7, "latter": 7, "function1": 7, "function2": 7, "differenti": 7, "purpos": 7, "import": 7, "distinguish": 7, "fall": 7, "avoid": 7, "potenti": 7, "expens": 7, "doe": 7, "expos": 7, "sqlite3_stmt": 7, "someth": 7, "stabil": 7, "prevent": 7, "intern": 7, "dynam": 7, "termin": 7, "length": 7, "lot": 7, "getcursorpo": 7, "retriev": 7, "cursor": 7, "posit": 7, "kernel32": 7, "point": 7, "x": 7, "y": 7, "po": 7, "kind": 7, "orient": 7, "pair": 7, "dedic": 7, "delet": 7, "obviou": 7, "found": 7, "stdio": 7, "fopen": 7, "fclose": 7, "manipul": 7, "fread": 7, "ftell": 7, "manag": 7, "builder": 7, "concaten": 7, "mix": 7, "fizzbuzz": 7, "hidden": 7, "behind": 7, "destroi": 7, "concatnew": 7, "concatnewout": 7, "concatfre": 7, "clang": 7, "fpic": 7, "wall": 7, "o2": 7, "stdlib": 7, "stdbool": 7, "errno": 7, "fragment": 7, "size_t": 7, "len": 7, "concat": 7, "malloc": 7, "fprintf": 7, "stderr": 7, "strerror": 7, "fals": 7, "concatappend": 7, "frag": 7, "strlen": 7, "memcpi": 7, "concatbuild": 7, "r": 7, "stupid": 7, "try": 7, "failur": 7, "i": 7, "30": 7, "15": 7, "buzz": 7, "fizz": 7, "infer": 7, "itself": 7, "sentinel": 7, "translat": 7, "typedarrai": 7, "proper": 7, "notion": 7, "fat": 7, "yourself": 7, "calcul": 7, "stdint": 7, "computetotallength": 7, "ptr": 7, "14n": 7, "just": 7, "direct": 7, "document": 7, "findfirstfilew": 7, "findnextfilew": 7, "filetim": 7, "dwlowdatetim": 7, "dwhighdatetim": 7, "win32_find_data": 7, "dwfileattribut": 7, "ftcreationtim": 7, "ftlastaccesstim": 7, "ftlastwritetim": 7, "nfilesizehigh": 7, "nfilesizelow": 7, "dwreserved0": 7, "dwreserved1": 7, "cfilenam": 7, "260": 7, "calternatefilenam": 7, "dwfiletyp": 7, "obsolet": 7, "dwcreatortyp": 7, "wfinderflag": 7, "ushort": 7, "findfirstfil": 7, "findnextfil": 7, "findclos": 7, "getlasterror": 7, "dirnam": 7, "filenam": 7, "error_file_not_found": 7, "push": 7, "error_no_more_fil": 7, "among": 7, "variabl": 7, "invol": 7, "list1": 7, "list2": 7, "thank": 7, "transpar": 7, "approxim": 7, "singl": 7, "element": 7, "store": 7, "addint": 7, "dest": 7, "36": 7, "degener": 7, "emb": 7, "correct": 7, "uint8arrai": 7, "hint": 7, "those": 7, "exactli": 7, "foo1": 7, "foo": 7, "a16": 7, "foo2": 7, "hypothet": 7, "returnfoo1": 7, "returnfoo": 7, "p": 7, "returnfoo2": 7, "int16arrai": 7, "fill": 7, "truncat": 7, "buffer": 7, "alwai": 7, "nul": 7, "revers": 7, "explicitli": 7, "ask": 7, "explor": 7, "alignof": 7}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"benchmark": 0, "rand": 0, "result": 0, "linux": [0, 6], "x86_64": 0, "window": [0, 1, 6], "atoi": 0, "raylib": 0, "run": [0, 1], "contribut": 1, "bug": 1, "featur": 1, "request": 1, "build": 1, "from": 1, "sourc": 1, "other": 1, "platform": [1, 5], "test": 1, "todo": 1, "list": 1, "function": 2, "call": 2, "definit": 2, "classic": 2, "syntax": 2, "c": [2, 7], "like": 2, "prototyp": 2, "synchron": 2, "asynchron": 2, "variad": 2, "output": 2, "paramet": 2, "struct": [2, 7], "exampl": [2, 6], "opaqu": [2, 7], "handl": [2, 7], "javascript": 2, "callback": 2, "us": 2, "thread": 2, "safeti": 2, "koffi": 3, "overview": 3, "tabl": 3, "content": 3, "licens": 3, "memori": 4, "usag": 4, "how": 4, "work": 4, "default": 4, "set": 4, "support": 5, "quick": 6, "start": 6, "small": 6, "data": 7, "type": 7, "primit": 7, "pointer": 7, "arrai": 7, "fix": 7, "size": 7, "string": 7, "introspect": 7, "1": 3, "2": [], "4": [], "3": 3, "0": 3, "rc": []}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})
1
+ Search.setIndex({"docnames": ["benchmarks", "changes", "contribute", "functions", "index", "memory", "platforms", "start", "types"], "filenames": ["benchmarks.md", "changes.md", "contribute.md", "functions.md", "index.rst", "memory.md", "platforms.md", "start.md", "types.md"], "titles": ["Benchmarks", "Changelog", "Contributing", "Function calls", "Koffi 1.3.2", "Memory usage", "Supported platforms", "Quick start", "Data types"], "terms": {"here": [0, 2, 3, 4, 8], "quick": [0, 4], "overview": 0, "execut": [0, 3], "time": [0, 2, 7], "koffi": [0, 2, 3, 5, 6, 7, 8], "call": [0, 1, 4, 5, 6, 7, 8], "three": [0, 7, 8], "test": [0, 1, 4, 6], "case": [2, 3, 8], "one": [0, 3, 5, 7, 8], "base": [0, 3, 4, 8], "around": [0, 5, 8], "compar": 0, "theoret": 0, "ideal": 0, "implement": [0, 8], "These": [0, 2, 3, 8], "ar": [0, 2, 3, 5, 6, 7, 8], "detail": 0, "explain": 0, "below": [0, 1, 2, 3, 7, 8], "node": [0, 2, 3, 4, 6, 7], "ffi": [0, 3, 4, 7], "napi": 0, "thi": [0, 1, 2, 3, 4, 7, 8], "repeat": 0, "simpl": [0, 2, 3, 8], "standard": [0, 3, 8], "c": [0, 1, 2, 4, 5, 6, 7], "function": [0, 1, 2, 4, 7, 8], "ha": [0, 2, 3, 8], "first": [0, 2, 3, 7, 8], "refer": [0, 4, 8], "through": [0, 3, 8], "an": [0, 3, 5, 8], "n": [0, 2, 6, 7, 8], "api": [0, 2, 3, 7, 8], "modul": [0, 1, 4], "close": [0, 8], "limit": 0, "perfect": 0, "overhead": [0, 4], "js": [0, 1, 2, 3, 4, 6, 8], "second": [0, 3, 7, 8], "third": [0, 8], "us": [0, 1, 2, 4, 5, 6, 7, 8], "offici": [0, 2, 6], "becaus": [0, 2, 3, 8], "pretti": [0, 2], "small": [0, 3, 4], "clearli": 0, "visibl": 0, "The": [0, 1, 2, 3, 5, 6, 7, 8], "were": 0, "measur": 0, "my": [0, 2], "machin": [0, 2], "amd": 0, "ryzen": 0, "7": 0, "4700u": 0, "iter": [0, 8], "total": [0, 8], "rel": 0, "perform": [0, 4], "rand_napi": 0, "20000000": 0, "1": [0, 2, 5, 6, 8], "44": 0, "baselin": 0, "rand_koffi": 0, "2": [0, 5, 6, 8], "60": 0, "x0": 0, "55": 0, "81": [0, 2], "rand_node_ffi": 0, "107": 0, "58": 0, "01": 0, "7400": 0, "intel": 0, "core": 0, "i5": 0, "4460": 0, "10": 0, "3": [0, 2, 6, 8], "87": 0, "54": 0, "84": 0, "02": 0, "4100": 0, "similar": [0, 3], "which": [0, 2, 6, 7], "take": [0, 8], "string": [0, 1, 2, 3, 5, 7], "paramet": [0, 4, 7, 8], "javascript": [0, 4, 8], "v8": [0, 3], "convers": [0, 1, 8], "slow": [0, 2], "heavi": 0, "atoi_napi": 0, "97": 0, "atoi_koffi": 0, "5": [0, 3, 8], "07": 0, "71": 0, "atoi_node_ffi": 0, "693": 0, "16": [0, 8], "005": 0, "23000": 0, "91": 0, "50": 0, "99": 0, "479": 0, "34": 0, "006": 0, "16000": 0, "cpu": 0, "imag": 0, "draw": 0, "much": [0, 2], "heavier": 0, "than": [0, 5], "thu": 0, "reduc": 0, "In": [0, 3, 8], "full": [0, 2, 8], "version": [0, 1, 2, 3, 4, 6, 8], "code": [0, 1, 3, 4, 5], "nativ": [0, 3], "wrapper": [0, 2], "raylib_cc": 0, "100": 0, "9": [0, 1], "31": 0, "x1": 0, "17": 0, "15": [0, 8], "raylib_node_raylib": 0, "90": 0, "raylib_koffi": 0, "12": [0, 2, 6], "86": 0, "18": [0, 8], "raylib_node_ffi": 0, "35": 0, "76": 0, "30": [0, 8], "228": 0, "67": 0, "05": 0, "14": [0, 1, 8], "23": 0, "63": 0, "27": [0, 3], "270": 0, "open": [0, 3, 8], "consol": [0, 3, 5, 8], "go": [0, 2], "cnoke": [0, 2], "befor": [0, 1, 2, 8], "do": [0, 2, 8], "anyth": 0, "els": [0, 8], "cd": [0, 2], "onc": [0, 2, 3, 5, 7, 8], "done": [0, 2, 3, 8], "you": [0, 2, 3, 4, 6, 7, 8], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8], "each": [0, 2, 3, 8], "e": [0, 3, 8], "g": [0, 2, 3, 8], "build": [0, 1, 4, 6, 8], "option": [0, 2, 3, 4, 8], "defin": [0, 8], "custom": 0, "number": [0, 5, 8], "10000000": 0, "main": [1, 3], "fix": [1, 2, 4], "support": [1, 2, 3, 4, 8], "compil": [0, 1, 6], "mode": 1, "grace": 1, "degrad": 1, "older": [1, 6], "toolchain": 1, "linux": [1, 2, 4, 6], "debian": [1, 2], "prebuilt": [1, 2, 6], "binari": [1, 2, 6], "when": [1, 2, 3, 5, 8], "instal": [1, 2, 6, 7], "rebuild": 1, "happen": [1, 3, 5, 8], "fail": [1, 2, 3, 8], "load": [1, 3, 7, 8], "major": [1, 2], "chang": [1, 2, 3, 5, 8], "expand": 1, "move": 1, "document": [1, 8], "http": [1, 2, 4], "dev": [1, 2], "arrai": [1, 2, 4], "typedarrai": [1, 8], "pointer": [1, 3, 4], "argument": [1, 3, 8], "input": [1, 3, 8], "output": [1, 4, 7, 8], "mix": [1, 2, 8], "other": [1, 3, 8], "convert": [1, 3, 8], "null": [1, 3, 7, 8], "instead": [1, 2, 8], "crash": 1, "return": [1, 3, 8], "valu": [1, 3, 4, 7, 8], "struct": [1, 2, 4, 5, 7], "member": [1, 3, 8], "callback": [1, 4, 5, 6, 8], "default": [1, 2, 3, 4, 8], "hint": [1, 8], "char": [1, 3, 7, 8], "char16": [1, 8], "char16_t": [1, 8], "definit": [1, 4, 8], "long": [1, 8], "type": [1, 2, 3, 4, 7], "window": [1, 4, 6], "x64": 1, "llp64": [1, 8], "model": 1, "restrict": [1, 2], "automat": [1, 2, 3], "sign": [1, 8], "detect": 1, "float": [1, 3, 6, 8], "point": [1, 8], "abi": [1, 2, 6, 8], "arm32": [1, 6], "risc": [1, 6], "v": [1, 6], "forbid": 1, "duplic": 1, "name": [1, 2, 3, 8], "new": [1, 3, 5, 8], "featur": [1, 4], "arm64": [1, 2, 6], "now": [1, 2, 7, 8], "A": [1, 6, 8], "maco": [1, 2, 6], "m1": 1, "includ": [1, 2, 3, 6, 8], "entri": 1, "sinc": [1, 4], "cdecl": [1, 3, 6], "stdcall": [1, 3, 6, 7], "all": [1, 6, 8], "platform": [1, 3, 4, 5, 8], "64": [1, 3, 6, 8], "lp64d": [1, 6], "lp64": [1, 6, 8], "untest": [1, 6], "expos": [1, 8], "set": [1, 4], "memori": [1, 2, 3, 4, 8], "usag": [1, 4], "synchron": [1, 4, 5], "asynchron": [1, 4, 5], "transpar": [1, 8], "between": 1, "buffer": [1, 8], "tent": 1, "excess": 1, "stack": [1, 5], "align": [1, 8], "x86": [1, 3, 6, 7], "potenti": [1, 8], "problem": 1, "big": [1, 5, 8], "int64_t": [1, 7, 8], "uint64_t": [1, 8], "possibl": [1, 2, 8], "layout": 1, "error": [1, 3, 8], "push": [1, 8], "pop": 1, "issu": [1, 2, 3], "incomplet": 1, "buggi": 1, "hfa": [1, 2], "openbsd": [1, 6], "caus": [1, 3], "miss": [1, 2], "map_stack": 1, "flag": 1, "non": [1, 3, 8], "sens": 1, "intern": [1, 8], "fals": [1, 8], "normal": [1, 5, 8], "make": [1, 2], "sure": [1, 2], "we": [1, 2, 8], "have": [1, 2, 7, 8], "redzon": 1, "architectur": [1, 2, 3, 4, 6, 8], "slower": 1, "alloc": [1, 2, 5, 8], "object": [1, 2, 3, 5, 8], "repositori": 2, "luigi": 2, "monorepo": 2, "contain": [2, 8], "multipl": 2, "project": 2, "idea": 2, "github": 2, "com": 2, "koromix": 2, "program": [2, 3, 4], "assembl": [2, 5], "specif": [2, 5], "It": [2, 3, 7, 8], "addon": 2, "interact": 2, "person": 2, "prefer": 2, "goe": 2, "rather": 2, "like": [2, 7, 8], "care": 2, "templat": 2, "mainli": 2, "littl": 2, "orient": [2, 8], "i": [2, 8], "strongli": 2, "tag": 2, "union": 2, "over": 2, "inherit": 2, "virtual": 2, "method": 2, "except": [2, 3], "disabl": [1, 2], "provid": [2, 3, 8], "packag": [2, 6], "npm": [2, 6, 7], "archiv": 2, "so": [2, 3, 7, 8], "most": [2, 3, 8], "should": 2, "If": 2, "want": 2, "hack": 2, "follow": [2, 3, 6, 8], "instruct": [2, 3], "depend": [2, 3, 8], "met": 2, "desktop": 2, "develop": 2, "workload": 2, "visual": 2, "studio": 2, "2022": 2, "2019": 2, "tool": 2, "compon": 2, "cmake": 2, "meta": 2, "system": [2, 7], "later": [2, 4, 6], "command": 2, "benchmark": [2, 4], "directori": [2, 8], "what": 2, "gcc": 2, "8": [2, 3, 8], "newer": 2, "gnu": [2, 4], "emul": 2, "acceler": 2, "qemu": 2, "need": [2, 3, 8], "even": 2, "gui": 2, "ubuntu": 2, "directli": [2, 8], "licens": 2, "size": [2, 4, 5], "reason": [2, 8], "thei": [2, 3, 8], "avail": [2, 5], "file": [2, 3, 8], "For": [2, 3, 5, 6, 8], "exampl": [2, 4, 8], "wget": 2, "q": 2, "o": [2, 8], "qemu_debian_arm64": 2, "tar": 2, "zst": 2, "zstd": 2, "d": [2, 3, 8], "xv": 2, "sha256sum": 2, "ignor": [2, 3], "registri": 2, "txt": 2, "note": [2, 8], "disk": 2, "content": [2, 8], "mai": [2, 3], "checksum": 2, "been": 2, "least": [2, 5], "And": [2, 7], "sever": [2, 3], "help": 2, "patient": 2, "ccach": 2, "subsequ": [2, 5], "step": 2, "get": [2, 5, 7, 8], "more": [2, 3, 4, 5, 8], "toler": 2, "By": [2, 3, 8], "start": [2, 3, 4], "stop": 2, "But": [2, 8], "ahead": 2, "without": [2, 6], "shut": 2, "down": 2, "again": 2, "everyth": 2, "also": [2, 8], "subset": 2, "cycl": 2, "debian_x64": 2, "debian_i386": 2, "separ": 2, "shutdown": 2, "final": [2, 8], "join": 2, "ssh": 2, "shortcut": 2, "some": [2, 8], "debug": 2, "ani": [2, 4, 8], "manual": 2, "procedur": [2, 3], "configur": 2, "vnc": 2, "server": 2, "local": [2, 7], "access": 2, "displai": 2, "krdc": 2, "compat": 2, "viewer": 2, "info": 2, "port": 2, "after": [2, 3], "releas": 2, "0": [2, 3, 4, 8], "current": [2, 7, 8], "prioriti": 2, "next": [2, 8], "autom": 2, "aarch64": [2, 6], "how": [2, 3, 4, 8], "creat": [2, 3, 8], "real": 2, "world": [2, 3, 7, 8], "librari": [2, 3, 7, 8], "raylib": [2, 4], "sqlite": [2, 3], "libsodium": 2, "illustr": [2, 7, 8], "work": [2, 4], "variou": [1, 2], "plan": 2, "eventu": 2, "necessarili": 2, "order": [2, 3], "optim": [1, 2], "pass": [2, 3, 8], "helper": 2, "add": [2, 8], "parser": [2, 3], "wai": [2, 7, 8], "encod": [2, 8], "decod": 2, "byte": [2, 5, 8], "better": 2, "deal": [2, 3, 8], "caller": 2, "heap": [2, 5], "etc": [2, 3], "powerpc": 2, "power9": 2, "unwind": 2, "cfi": 2, "direct": [2, 8], "experi": 2, "To": 3, "declar": [3, 7, 8], "share": [3, 7, 8], "const": [3, 7, 8], "requir": [3, 6, 7, 8], "lib": [3, 7, 8], "path": [3, 8], "extens": 3, "dll": [3, 7, 8], "dylib": 3, "from": [3, 4, 6, 8], "two": [3, 5, 8], "inspir": 3, "specifi": [3, 8], "its": [3, 8], "mangl": 3, "ellipsi": 3, "last": [3, 8], "printf": [3, 7], "func": [3, 7, 8], "int": [3, 7, 8], "atoi": [3, 4], "tri": 3, "convent": [3, 6, 7], "see": [3, 4, 8], "section": [3, 8], "inform": [3, 4, 8], "subject": 3, "shown": 3, "fmt": 3, "onli": [3, 6, 8], "per": 3, "process": 3, "32": 3, "bit": 3, "form": 3, "descript": [3, 5], "__stdcall": [3, 8], "within": 3, "win32": [3, 7, 8], "fastcal": [3, 6], "__fastcal": 3, "rare": [3, 8], "ecx": 3, "edx": 3, "thiscal": [3, 6], "__thiscal": 3, "safe": 3, "simpli": [3, 8], "find": [3, 4, 7, 8], "show": [3, 7, 8], "user32": [3, 7], "equival": [3, 8], "messageboxa_1": 3, "messageboxa": [3, 7], "void": [1, 3, 7, 8], "uint": [3, 7, 8], "messageboxa_2": 3, "hwnd": 3, "text": 3, "caption": 3, "async": 3, "err": 3, "re": 3, "libc": [3, 7], "6": [3, 7, 8], "str": [3, 8], "1257": 3, "log": [3, 5, 8], "result": [3, 4, 7, 8], "hello": [3, 7, 8], "print": [3, 7, 8], "worker": 3, "your": [3, 4], "respons": 3, "data": [3, 4], "multi": 3, "easili": 3, "style": [3, 4], "promis": 3, "util": 3, "promisifi": 3, "cannot": [3, 8], "must": 3, "addit": [3, 8], "expect": [3, 6, 8], "doubl": [3, 6, 8], "THE": 3, "end": 3, "integ": [1, 3, 8], "s": [3, 8], "On": 3, "forward": [3, 6], "howev": [3, 8], "mani": [3, 8], "simplici": 3, "semant": [3, 8], "primit": [3, 4], "marshal": 3, "out": [3, 8], "timev": [3, 7], "where": [0, 3, 8], "inout": 3, "dual": 3, "same": [3, 5, 8], "msdn": 3, "qualifi": 3, "_out_": [3, 7, 8], "_inout_": [3, 8], "posix": 3, "gettimeofdai": [3, 7], "tv_sec": [3, 7], "unsign": [1, 3, 7, 8], "tv_usec": [3, 7], "timezon": [3, 7], "tz_minuteswest": [3, 7], "tz_dsttime": [3, 7], "tv": [3, 7], "tz": [3, 7], "let": [3, 5, 7, 8], "databas": 3, "sqlite3_db": 3, "copi": [3, 8], "sqlite3_open_v2": 3, "sqlite_open_readwrit": 3, "0x2": 3, "sqlite_open_cr": 3, "0x4": 3, "db": 3, "throw": [3, 8], "sqlite3_close_v2": 3, "With": 3, "noth": 3, "examplecallback": 3, "sum": [3, 8], "adddoublefloat": 3, "f": [3, 8], "them": [3, 8], "part": 3, "h": [3, 8], "transfertoj": 3, "ag": 3, "cb": 3, "buf": 3, "snprintf": 3, "sizeof": [3, 8], "transfercallback": 3, "ret": 3, "niel": 3, "42": [3, 8], "precis": [3, 6], "intepret": 3, "anoth": [3, 8], "undefin": 3, "behavior": [3, 8], "lead": 3, "mess": [3, 8], "fast": 4, "easi": 4, "low": 4, "aggreg": 4, "both": [4, 8], "well": 4, "popular": 4, "os": [4, 6, 8], "combin": [4, 6], "introspect": 4, "variad": [4, 7], "rand": 4, "run": [4, 7], "contribut": 4, "bug": 4, "request": 4, "sourc": [4, 6], "todo": 4, "list": [4, 8], "changelog": 4, "4": [4, 8], "free": [4, 8], "softwar": 4, "redistribut": 4, "modifi": [4, 8], "under": 4, "term": 4, "affero": 4, "gener": [4, 8], "public": 4, "publish": 4, "foundat": 4, "either": [4, 8], "www": 4, "org": 4, "prealloc": 5, "block": 5, "One": 5, "construct": 5, "assign": [5, 8], "mib": 5, "unless": 5, "veri": 5, "page": 5, "extra": 5, "ever": 5, "dure": 5, "config": 5, "obj": 5, "appli": [5, 8], "true": [5, 8], "made": 5, "unus": 5, "resid": 5, "still": 5, "finish": 5, "freed": 5, "resident_async_pool": 5, "left": 5, "sync_stack_s": 5, "sync_heap_s": 5, "async_stack_s": 5, "512": 5, "kib": 5, "async_heap_s": 5, "pool": 5, "moment": 6, "isa": 6, "freebsd": 6, "ia32": 6, "ye": 6, "x86_64": 6, "amd64": 6, "le": [6, 8], "probabl": 6, "fulli": 6, "green": 6, "check": 6, "mark": 6, "mean": [6, 8], "earlier": 6, "nvm": 6, "recent": 6, "distribut": 6, "ms": 6, "hard": 6, "vfp": 6, "coprocessor": 6, "differ": [6, 8], "softfp": 6, "soft": 6, "theori": 6, "lp64f": 6, "prototyp": 7, "languag": 7, "syntax": 7, "time_t": 7, "tm": 7, "tm_sec": 7, "tm_min": 7, "tm_hour": 7, "tm_mdai": 7, "tm_mon": 7, "tm_year": 7, "tm_wdai": 7, "tm_ydai": 7, "tm_isdst": 7, "localtime_r": 7, "format": 7, "02d": 7, "target": 7, "messagebox": 7, "messag": 7, "user": [7, 8], "constant": 7, "mb_iconinform": 7, "0x40": 7, "foobar": 7, "while": 8, "allow": 8, "variat": 8, "enforc": 8, "signed": 8, "valid": 8, "int8": 8, "int8_t": 8, "uint8": 8, "uint8_t": 8, "uchar": 8, "int16": 8, "int16_t": 8, "uint16": 8, "uint16_t": 8, "short": 8, "int32": 8, "int32_t": 8, "uint32": 8, "uint32_t": 8, "int64": 8, "uint64": 8, "longlong": 8, "ulonglong": 8, "float32": 8, "float64": 8, "few": 8, "boolean": 8, "bool": 8, "usual": 8, "ulong": 8, "utf": 8, "string16": 8, "line": 8, "struct1": 8, "dummi": 8, "struct2": 8, "vice": 8, "versa": 8, "unlik": 8, "omit": 8, "anonym": 8, "typedef": 8, "b": 8, "d1": 8, "d2": 8, "rule": 8, "regard": 8, "pad": 8, "latter": 8, "function1": 8, "function2": 8, "differenti": 8, "purpos": 8, "import": 8, "distinguish": 8, "fall": 8, "avoid": 8, "expens": 8, "doe": 8, "sqlite3_stmt": 8, "someth": 8, "stabil": 8, "prevent": 8, "dynam": 8, "termin": 8, "length": 8, "lot": 8, "getcursorpo": 8, "retriev": 8, "cursor": 8, "posit": 8, "kernel32": 8, "x": 8, "y": 8, "po": 8, "kind": 8, "pair": 8, "dedic": 8, "delet": 8, "obviou": 8, "found": 8, "stdio": 8, "fopen": 8, "fclose": 8, "manipul": 8, "fread": 8, "ftell": 8, "manag": 8, "builder": 8, "concaten": 8, "fizzbuzz": 8, "hidden": 8, "behind": 8, "destroi": 8, "concatnew": 8, "concatnewout": 8, "concatfre": 8, "clang": 8, "fpic": 8, "wall": 8, "o2": 8, "stdlib": 8, "stdbool": 8, "errno": 8, "fragment": 8, "size_t": 8, "len": 8, "concat": 8, "malloc": 8, "fprintf": 8, "stderr": 8, "strerror": 8, "concatappend": 8, "frag": 8, "strlen": 8, "memcpi": 8, "concatbuild": 8, "r": 8, "stupid": 8, "try": 8, "failur": 8, "buzz": 8, "fizz": 8, "infer": 8, "itself": 8, "sentinel": 8, "translat": 8, "proper": 8, "notion": 8, "fat": 8, "yourself": 8, "calcul": 8, "stdint": 8, "computetotallength": 8, "ptr": 8, "14n": 8, "just": 8, "findfirstfilew": 8, "findnextfilew": 8, "filetim": 8, "dwlowdatetim": 8, "dwhighdatetim": 8, "win32_find_data": 8, "dwfileattribut": 8, "ftcreationtim": 8, "ftlastaccesstim": 8, "ftlastwritetim": 8, "nfilesizehigh": 8, "nfilesizelow": 8, "dwreserved0": 8, "dwreserved1": 8, "cfilenam": 8, "260": 8, "calternatefilenam": 8, "dwfiletyp": 8, "obsolet": 8, "dwcreatortyp": 8, "wfinderflag": 8, "ushort": 8, "findfirstfil": 8, "findnextfil": 8, "findclos": 8, "getlasterror": 8, "dirnam": 8, "filenam": 8, "error_file_not_found": 8, "error_no_more_fil": 8, "among": 8, "variabl": 8, "invol": 8, "list1": 8, "list2": 8, "thank": 8, "approxim": [0, 8], "singl": 8, "element": 8, "store": 8, "addint": 8, "dest": 8, "36": 8, "degener": 8, "emb": 8, "correct": 8, "uint8arrai": 8, "those": 8, "exactli": 8, "foo1": 8, "foo": 8, "a16": 8, "foo2": 8, "hypothet": 8, "returnfoo1": 8, "returnfoo": 8, "p": 8, "returnfoo2": 8, "int16arrai": 8, "fill": 8, "truncat": 8, "alwai": 8, "nul": 8, "revers": 8, "explicitli": 8, "ask": 8, "explor": 8, "alignof": 8, "pre": 0, "static": 0, "glue": 0, "clone": 2, "git": 2, "As": 2, "said": 2, "monorepositori": 2, "conta": 2, "henc": 2, "misconvers": 1, "empti": 1, "signatur": 1, "unsaf": 1, "improv": 1}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"benchmark": 0, "rand": 0, "result": 0, "linux": [0, 7], "x86_64": 0, "window": [0, 2, 7], "atoi": 0, "raylib": 0, "run": [0, 2], "changelog": 1, "koffi": [1, 4], "1": [1, 4], "3": [1, 4], "2": [1, 4], "0": 1, "4": 1, "contribut": 2, "bug": 2, "featur": 2, "request": 2, "code": 2, "style": 2, "build": 2, "from": 2, "sourc": 2, "other": 2, "platform": [2, 6], "test": 2, "todo": 2, "list": 2, "function": 3, "call": 3, "definit": 3, "classic": 3, "syntax": 3, "c": [3, 8], "like": 3, "prototyp": 3, "synchron": 3, "asynchron": 3, "variad": 3, "output": 3, "paramet": 3, "struct": [3, 8], "exampl": [3, 7], "opaqu": [3, 8], "handl": [3, 8], "javascript": 3, "callback": 3, "us": 3, "thread": 3, "safeti": 3, "overview": 4, "tabl": 4, "content": 4, "licens": 4, "memori": 5, "usag": 5, "how": 5, "work": 5, "default": 5, "set": 5, "support": 6, "quick": 7, "start": 7, "small": 7, "data": 8, "type": 8, "primit": 8, "pointer": 8, "arrai": 8, "fix": 8, "size": 8, "string": 8, "introspect": 8}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 56}})
@@ -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"><a class="reference internal" href="benchmarks">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>
@@ -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"><a class="reference internal" href="benchmarks">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>
package/doc/functions.md CHANGED
@@ -78,6 +78,8 @@ console.log('Hello World!');
78
78
  // This program will print "Hello World!", and then "Result: 1257"
79
79
  ```
80
80
 
81
+ These calls are executed by worker threads. It is **your responsibility to deal with data sharing issues** in the native code that may be caused by multi-threading.
82
+
81
83
  You can easily convert this callback-style async function to a promise-based version with `util.promisify()` from the Node.js standard library.
82
84
 
83
85
  Variadic functions cannot be called asynchronously.
package/doc/index.rst CHANGED
@@ -6,7 +6,7 @@ Overview
6
6
 
7
7
  Koffi is a **fast and easy-to-use C FFI module for Node.js**, featuring:
8
8
 
9
- * Low-overhead and fast performance (see :ref:`Benchmarks`)
9
+ * Low-overhead and fast performance (see :ref:`benchmarks<Benchmarks>`)
10
10
  * Support for primitive and aggregate data types (structs and fixed-size arrays), both by reference (pointer) and by value
11
11
  * Javascript functions can be used as C callbacks (since 1.2.0)
12
12
  * Well-tested code base for :ref:`popular OS/architecture combinations<Supported platforms>`
@@ -24,6 +24,7 @@ Table of contents
24
24
  memory
25
25
  benchmarks
26
26
  contribute
27
+ changes
27
28
 
28
29
  License
29
30
  -------
package/doc/platforms.md CHANGED
@@ -12,6 +12,8 @@ RISC-V 64 [^3] | ⬜️ *N/A* | ✅ Yes | ⬜️ *N/A* | 🟨 Probab
12
12
 
13
13
  For all fully supported platforms (green check marks), a prebuilt binary is included in the NPM package which means you can install Koffi without a C++ compiler.
14
14
 
15
+ Node 12 or later is required, earlier versions are not supported. Use [NVM](https://github.com/nvm-sh/nvm) to install recent Node versions on older Linux distributions.
16
+
15
17
  [^1]: The following call conventions are supported for forward calls: cdecl, stdcall, MS fastcall, thiscall. Only cdecl and stdcall can be used for C to JS callbacks.
16
18
  [^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).
17
19
  [^3]: The prebuilt binary uses the LP64D (double-precision float) ABI. The LP64 ABI is supported in theory if you build Koffi from source (untested), the LP64F ABI is not supported.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koffi",
3
- "version": "1.3.0",
3
+ "version": "1.3.3",
4
4
  "description": "Fast and simple C FFI (foreign function interface) for Node.js",
5
5
  "keywords": [
6
6
  "foreign",
@@ -19,13 +19,13 @@
19
19
  "author": "Niels Martignène <niels.martignene@protonmail.com>",
20
20
  "main": "src/index.js",
21
21
  "scripts": {
22
- "install": "cnoke --prebuild build/qemu/{{version}}/koffi_{{platform}}_{{arch}}.tar.gz",
22
+ "install": "cnoke --prebuild build/qemu/{{version}}/koffi_{{platform}}_{{arch}}.tar.gz --require ./build/koffi.node",
23
23
  "test": "node qemu/qemu.js",
24
24
  "prepublishOnly": "node qemu/qemu.js pack"
25
25
  },
26
26
  "license": "AGPL-3.0",
27
27
  "dependencies": {
28
- "cnoke": "^2.0.0"
28
+ "cnoke": "^2.0.3"
29
29
  },
30
30
  "devDependencies": {
31
31
  "chalk": "^4.1.2",
@@ -56,6 +56,7 @@
56
56
  "vendor",
57
57
  "LICENSE.txt",
58
58
  "README.md",
59
+ "ChangeLog.md",
59
60
  "CMakeLists.txt",
60
61
  "build/qemu/*/*.tar.gz"
61
62
  ]
package/qemu/qemu.js CHANGED
@@ -249,7 +249,7 @@ async function start(detach = true) {
249
249
  let version = fs.existsSync(filename) ? parseInt(fs.readFileSync(filename).toString(), 10) : 0;
250
250
 
251
251
  if (version != machine.qemu.version) {
252
- log(machine, 'Download newer machine', chalk.bold.gray('[ignore]'));
252
+ log(machine, 'Machine version mismatch', chalk.bold.gray('[ignore]'));
253
253
 
254
254
  ignore.add(machine);
255
255
  missing++;
@@ -352,6 +352,7 @@ async function pack() {
352
352
  console.error(str);
353
353
  }
354
354
 
355
+ ignore.add(machine);
355
356
  success = false;
356
357
  }
357
358
  }));
package/src/abi_arm32.cc CHANGED
@@ -497,14 +497,14 @@ Napi::Value CallData::Complete()
497
497
  switch (func->ret.type->primitive) {
498
498
  case PrimitiveKind::Void: return env.Null();
499
499
  case PrimitiveKind::Bool: return Napi::Boolean::New(env, result.u32);
500
- case PrimitiveKind::Int8:
501
- case PrimitiveKind::UInt8:
502
- case PrimitiveKind::Int16:
503
- case PrimitiveKind::UInt16:
504
- case PrimitiveKind::Int32:
500
+ case PrimitiveKind::Int8: return Napi::Number::New(env, (double)result.i8);
501
+ case PrimitiveKind::UInt8: return Napi::Number::New(env, (double)result.u8);
502
+ case PrimitiveKind::Int16: return Napi::Number::New(env, (double)result.i16);
503
+ case PrimitiveKind::UInt16: return Napi::Number::New(env, (double)result.u16);
504
+ case PrimitiveKind::Int32: return Napi::Number::New(env, (double)result.i32);
505
505
  case PrimitiveKind::UInt32: return Napi::Number::New(env, (double)result.u32);
506
- case PrimitiveKind::Int64: return Napi::BigInt::New(env, (int64_t)result.u64);
507
- case PrimitiveKind::UInt64: return Napi::BigInt::New(env, result.u64);
506
+ case PrimitiveKind::Int64: return NewBigInt(env, result.i64);
507
+ case PrimitiveKind::UInt64: return NewBigInt(env, result.u64);
508
508
  case PrimitiveKind::String: return result.ptr ? Napi::String::New(env, (const char *)result.ptr) : env.Null();
509
509
  case PrimitiveKind::String16: return result.ptr ? Napi::String::New(env, (const char16_t *)result.ptr) : env.Null();
510
510
  case PrimitiveKind::Pointer:
@@ -603,7 +603,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
603
603
  int64_t v = *(int64_t *)(param.gpr_count ? gpr_ptr : args_ptr);
604
604
  (param.gpr_count ? gpr_ptr : args_ptr) += 2;
605
605
 
606
- Napi::Value arg = Napi::BigInt::New(env, v);
606
+ Napi::Value arg = NewBigInt(env, v);
607
607
  arguments.Append(arg);
608
608
  } break;
609
609
  case PrimitiveKind::UInt64: {
@@ -612,7 +612,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
612
612
  uint64_t v = *(uint64_t *)(param.gpr_count ? gpr_ptr : args_ptr);
613
613
  (param.gpr_count ? gpr_ptr : args_ptr) += 2;
614
614
 
615
- Napi::Value arg = Napi::BigInt::New(env, v);
615
+ Napi::Value arg = NewBigInt(env, v);
616
616
  arguments.Append(arg);
617
617
  } break;
618
618
  case PrimitiveKind::String: {
package/src/abi_arm64.cc CHANGED
@@ -518,14 +518,14 @@ Napi::Value CallData::Complete()
518
518
  switch (func->ret.type->primitive) {
519
519
  case PrimitiveKind::Void: return env.Null();
520
520
  case PrimitiveKind::Bool: return Napi::Boolean::New(env, result.u32);
521
- case PrimitiveKind::Int8:
522
- case PrimitiveKind::UInt8:
523
- case PrimitiveKind::Int16:
524
- case PrimitiveKind::UInt16:
525
- case PrimitiveKind::Int32:
521
+ case PrimitiveKind::Int8: return Napi::Number::New(env, (double)result.i8);
522
+ case PrimitiveKind::UInt8: return Napi::Number::New(env, (double)result.u8);
523
+ case PrimitiveKind::Int16: return Napi::Number::New(env, (double)result.i16);
524
+ case PrimitiveKind::UInt16: return Napi::Number::New(env, (double)result.u16);
525
+ case PrimitiveKind::Int32: return Napi::Number::New(env, (double)result.i32);
526
526
  case PrimitiveKind::UInt32: return Napi::Number::New(env, (double)result.u32);
527
- case PrimitiveKind::Int64: return Napi::BigInt::New(env, (int64_t)result.u64);
528
- case PrimitiveKind::UInt64: return Napi::BigInt::New(env, result.u64);
527
+ case PrimitiveKind::Int64: return NewBigInt(env, result.i64);
528
+ case PrimitiveKind::UInt64: return NewBigInt(env, result.u64);
529
529
  case PrimitiveKind::String: return result.ptr ? Napi::String::New(env, (const char *)result.ptr) : env.Null();
530
530
  case PrimitiveKind::String16: return result.ptr ? Napi::String::New(env, (const char16_t *)result.ptr) : env.Null();
531
531
  case PrimitiveKind::Pointer:
@@ -703,7 +703,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
703
703
 
704
704
  int64_t v = *(int64_t *)((param.gpr_count ? gpr_ptr : args_ptr)++);
705
705
 
706
- Napi::Value arg = Napi::BigInt::New(env, v);
706
+ Napi::Value arg = NewBigInt(env, v);
707
707
  arguments.Append(arg);
708
708
  } break;
709
709
  case PrimitiveKind::UInt64: {
@@ -713,7 +713,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
713
713
 
714
714
  uint64_t v = *(uint64_t *)((param.gpr_count ? gpr_ptr : args_ptr)++);
715
715
 
716
- Napi::Value arg = Napi::BigInt::New(env, v);
716
+ Napi::Value arg = NewBigInt(env, v);
717
717
  arguments.Append(arg);
718
718
  } break;
719
719
  case PrimitiveKind::String: {
@@ -433,14 +433,14 @@ Napi::Value CallData::Complete()
433
433
  switch (func->ret.type->primitive) {
434
434
  case PrimitiveKind::Void: return env.Null();
435
435
  case PrimitiveKind::Bool: return Napi::Boolean::New(env, result.u32);
436
- case PrimitiveKind::Int8:
437
- case PrimitiveKind::UInt8:
438
- case PrimitiveKind::Int16:
439
- case PrimitiveKind::UInt16:
440
- case PrimitiveKind::Int32:
436
+ case PrimitiveKind::Int8: return Napi::Number::New(env, (double)result.i8);
437
+ case PrimitiveKind::UInt8: return Napi::Number::New(env, (double)result.u8);
438
+ case PrimitiveKind::Int16: return Napi::Number::New(env, (double)result.i16);
439
+ case PrimitiveKind::UInt16: return Napi::Number::New(env, (double)result.u16);
440
+ case PrimitiveKind::Int32: return Napi::Number::New(env, (double)result.i32);
441
441
  case PrimitiveKind::UInt32: return Napi::Number::New(env, (double)result.u32);
442
- case PrimitiveKind::Int64: return Napi::BigInt::New(env, (int64_t)result.u64);
443
- case PrimitiveKind::UInt64: return Napi::BigInt::New(env, result.u64);
442
+ case PrimitiveKind::Int64: return NewBigInt(env, result.i64);
443
+ case PrimitiveKind::UInt64: return NewBigInt(env, result.u64);
444
444
  case PrimitiveKind::String: return result.ptr ? Napi::String::New(env, (const char *)result.ptr) : env.Null();
445
445
  case PrimitiveKind::String16: return result.ptr ? Napi::String::New(env, (const char16_t *)result.ptr) : env.Null();
446
446
  case PrimitiveKind::Pointer:
@@ -541,13 +541,13 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
541
541
  case PrimitiveKind::Int64: {
542
542
  int64_t v = *(int64_t *)((param.gpr_count ? gpr_ptr : args_ptr)++);
543
543
 
544
- Napi::Value arg = Napi::BigInt::New(env, v);
544
+ Napi::Value arg = NewBigInt(env, v);
545
545
  arguments.Append(arg);
546
546
  } break;
547
547
  case PrimitiveKind::UInt64: {
548
548
  uint64_t v = *(uint64_t *)((param.gpr_count ? gpr_ptr : args_ptr)++);
549
549
 
550
- Napi::Value arg = Napi::BigInt::New(env, v);
550
+ Napi::Value arg = NewBigInt(env, v);
551
551
  arguments.Append(arg);
552
552
  } break;
553
553
  case PrimitiveKind::String: {
@@ -489,14 +489,14 @@ Napi::Value CallData::Complete()
489
489
  switch (func->ret.type->primitive) {
490
490
  case PrimitiveKind::Void: return env.Null();
491
491
  case PrimitiveKind::Bool: return Napi::Boolean::New(env, result.u32);
492
- case PrimitiveKind::Int8:
493
- case PrimitiveKind::UInt8:
494
- case PrimitiveKind::Int16:
495
- case PrimitiveKind::UInt16:
496
- case PrimitiveKind::Int32:
492
+ case PrimitiveKind::Int8: return Napi::Number::New(env, (double)result.i8);
493
+ case PrimitiveKind::UInt8: return Napi::Number::New(env, (double)result.u8);
494
+ case PrimitiveKind::Int16: return Napi::Number::New(env, (double)result.i16);
495
+ case PrimitiveKind::UInt16: return Napi::Number::New(env, (double)result.u16);
496
+ case PrimitiveKind::Int32: return Napi::Number::New(env, (double)result.i32);
497
497
  case PrimitiveKind::UInt32: return Napi::Number::New(env, (double)result.u32);
498
- case PrimitiveKind::Int64: return Napi::BigInt::New(env, (int64_t)result.u64);
499
- case PrimitiveKind::UInt64: return Napi::BigInt::New(env, result.u64);
498
+ case PrimitiveKind::Int64: return NewBigInt(env, result.i64);
499
+ case PrimitiveKind::UInt64: return NewBigInt(env, result.u64);
500
500
  case PrimitiveKind::String: return result.ptr ? Napi::String::New(env, (const char *)result.ptr) : env.Null();
501
501
  case PrimitiveKind::String16: return result.ptr ? Napi::String::New(env, (const char16_t *)result.ptr) : env.Null();
502
502
  case PrimitiveKind::Pointer:
@@ -592,13 +592,13 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
592
592
  case PrimitiveKind::Int64: {
593
593
  int64_t v = *(int64_t *)((param.gpr_count ? gpr_ptr : args_ptr)++);
594
594
 
595
- Napi::Value arg = Napi::BigInt::New(env, v);
595
+ Napi::Value arg = NewBigInt(env, v);
596
596
  arguments.Append(arg);
597
597
  } break;
598
598
  case PrimitiveKind::UInt64: {
599
599
  uint64_t v = *(uint64_t *)((param.gpr_count ? gpr_ptr : args_ptr)++);
600
600
 
601
- Napi::Value arg = Napi::BigInt::New(env, v);
601
+ Napi::Value arg = NewBigInt(env, v);
602
602
  arguments.Append(arg);
603
603
  } break;
604
604
  case PrimitiveKind::String: {