aboutsummaryrefslogtreecommitdiff
path: root/doc/ext_ffi_semantics.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ext_ffi_semantics.html')
-rw-r--r--doc/ext_ffi_semantics.html29
1 files changed, 23 insertions, 6 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html
index a21e5bd5..40575af8 100644
--- a/doc/ext_ffi_semantics.html
+++ b/doc/ext_ffi_semantics.html
@@ -45,6 +45,8 @@ td.convop { font-style: italic; width: 40%; }
45<a href="ext_jit.html">jit.* Library</a> 45<a href="ext_jit.html">jit.* Library</a>
46</li><li> 46</li><li>
47<a href="ext_c_api.html">Lua/C API</a> 47<a href="ext_c_api.html">Lua/C API</a>
48</li><li>
49<a href="ext_profiler.html">Profiler</a>
48</li></ul> 50</li></ul>
49</li><li> 51</li><li>
50<a href="status.html">Status</a> 52<a href="status.html">Status</a>
@@ -182,6 +184,8 @@ a <tt>typedef</tt>, except re-declarations will be ignored):
182<tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>, 184<tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>,
183<tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li> 185<tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li>
184 186
187<li>From <tt>&lt;unistd.h&gt;</tt> (POSIX): <tt>ssize_t</tt>.</li>
188
185</ul> 189</ul>
186<p> 190<p>
187You're encouraged to use these types in preference to 191You're encouraged to use these types in preference to
@@ -729,6 +733,22 @@ You'll have to explicitly convert a 64&nbsp;bit integer to a Lua
729number (e.g. for regular floating-point calculations) with 733number (e.g. for regular floating-point calculations) with
730<tt>tonumber()</tt>. But note this may incur a precision loss.</li> 734<tt>tonumber()</tt>. But note this may incur a precision loss.</li>
731 735
736<li><b>64&nbsp;bit bitwise operations</b>: the rules for 64&nbsp;bit
737arithmetic operators apply analogously.<br>
738
739Unlike the other <tt>bit.*</tt> operations, <tt>bit.tobit()</tt>
740converts a cdata number via <tt>int64_t</tt> to <tt>int32_t</tt> and
741returns a Lua number.<br>
742
743For <tt>bit.band()</tt>, <tt>bit.bor()</tt> and <tt>bit.bxor()</tt>, the
744conversion to <tt>int64_t</tt> or <tt>uint64_t</tt> applies to
745<em>all</em> arguments, if <em>any</em> argument is a cdata number.<br>
746
747For all other operations, only the first argument is used to determine
748the output type. This implies that a cdata number as a shift count for
749shifts and rotates is accepted, but that alone does <em>not</em> cause
750a cdata number output.
751
732</ul> 752</ul>
733 753
734<h3 id="cdata_comp">Comparisons of cdata objects</h3> 754<h3 id="cdata_comp">Comparisons of cdata objects</h3>
@@ -1200,14 +1220,12 @@ The following operations are currently not compiled and may exhibit
1200suboptimal performance, especially when used in inner loops: 1220suboptimal performance, especially when used in inner loops:
1201</p> 1221</p>
1202<ul> 1222<ul>
1203<li>Bitfield accesses and initializations.</li>
1204<li>Vector operations.</li> 1223<li>Vector operations.</li>
1205<li>Table initializers.</li> 1224<li>Table initializers.</li>
1206<li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li> 1225<li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li>
1207<li>Allocations of variable-length arrays or structs.</li> 1226<li>Non-default initialization of VLA/VLS or large C&nbsp;types
1208<li>Allocations of C&nbsp;types with a size &gt; 128&nbsp;bytes or an 1227(&gt; 128&nbsp;bytes or &gt; 16 array elements.</li>
1209alignment &gt; 8&nbsp;bytes.</li> 1228<li>Bitfield initializations.</li>
1210<li>Conversions from lightuserdata to <tt>void&nbsp;*</tt>.</li>
1211<li>Pointer differences for element sizes that are not a power of 1229<li>Pointer differences for element sizes that are not a power of
1212two.</li> 1230two.</li>
1213<li>Calls to C&nbsp;functions with aggregates passed or returned by 1231<li>Calls to C&nbsp;functions with aggregates passed or returned by
@@ -1223,7 +1241,6 @@ value.</li>
1223Other missing features: 1241Other missing features:
1224</p> 1242</p>
1225<ul> 1243<ul>
1226<li>Bit operations for 64&nbsp;bit types.</li>
1227<li>Arithmetic for <tt>complex</tt> numbers.</li> 1244<li>Arithmetic for <tt>complex</tt> numbers.</li>
1228<li>Passing structs by value to vararg C&nbsp;functions.</li> 1245<li>Passing structs by value to vararg C&nbsp;functions.</li>
1229<li><a href="extensions.html#exceptions">C++ exception interoperability</a> 1246<li><a href="extensions.html#exceptions">C++ exception interoperability</a>