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 ce6313d7..3444b8fb 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>
@@ -177,6 +179,8 @@ a <tt>typedef</tt>, except re-declarations will be ignored):
177<tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>, 179<tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>,
178<tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li> 180<tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li>
179 181
182<li>From <tt>&lt;unistd.h&gt;</tt> (POSIX): <tt>ssize_t</tt>.</li>
183
180</ul> 184</ul>
181<p> 185<p>
182You're encouraged to use these types in preference to 186You're encouraged to use these types in preference to
@@ -724,6 +728,22 @@ You'll have to explicitly convert a 64&nbsp;bit integer to a Lua
724number (e.g. for regular floating-point calculations) with 728number (e.g. for regular floating-point calculations) with
725<tt>tonumber()</tt>. But note this may incur a precision loss.</li> 729<tt>tonumber()</tt>. But note this may incur a precision loss.</li>
726 730
731<li><b>64&nbsp;bit bitwise operations</b>: the rules for 64&nbsp;bit
732arithmetic operators apply analogously.<br>
733
734Unlike the other <tt>bit.*</tt> operations, <tt>bit.tobit()</tt>
735converts a cdata number via <tt>int64_t</tt> to <tt>int32_t</tt> and
736returns a Lua number.<br>
737
738For <tt>bit.band()</tt>, <tt>bit.bor()</tt> and <tt>bit.bxor()</tt>, the
739conversion to <tt>int64_t</tt> or <tt>uint64_t</tt> applies to
740<em>all</em> arguments, if <em>any</em> argument is a cdata number.<br>
741
742For all other operations, only the first argument is used to determine
743the output type. This implies that a cdata number as a shift count for
744shifts and rotates is accepted, but that alone does <em>not</em> cause
745a cdata number output.
746
727</ul> 747</ul>
728 748
729<h3 id="cdata_comp">Comparisons of cdata objects</h3> 749<h3 id="cdata_comp">Comparisons of cdata objects</h3>
@@ -1195,14 +1215,12 @@ The following operations are currently not compiled and may exhibit
1195suboptimal performance, especially when used in inner loops: 1215suboptimal performance, especially when used in inner loops:
1196</p> 1216</p>
1197<ul> 1217<ul>
1198<li>Bitfield accesses and initializations.</li>
1199<li>Vector operations.</li> 1218<li>Vector operations.</li>
1200<li>Table initializers.</li> 1219<li>Table initializers.</li>
1201<li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li> 1220<li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li>
1202<li>Allocations of variable-length arrays or structs.</li> 1221<li>Non-default initialization of VLA/VLS or large C&nbsp;types
1203<li>Allocations of C&nbsp;types with a size &gt; 128&nbsp;bytes or an 1222(&gt; 128&nbsp;bytes or &gt; 16 array elements.</li>
1204alignment &gt; 8&nbsp;bytes.</li> 1223<li>Bitfield initializations.</li>
1205<li>Conversions from lightuserdata to <tt>void&nbsp;*</tt>.</li>
1206<li>Pointer differences for element sizes that are not a power of 1224<li>Pointer differences for element sizes that are not a power of
1207two.</li> 1225two.</li>
1208<li>Calls to C&nbsp;functions with aggregates passed or returned by 1226<li>Calls to C&nbsp;functions with aggregates passed or returned by
@@ -1218,7 +1236,6 @@ value.</li>
1218Other missing features: 1236Other missing features:
1219</p> 1237</p>
1220<ul> 1238<ul>
1221<li>Bit operations for 64&nbsp;bit types.</li>
1222<li>Arithmetic for <tt>complex</tt> numbers.</li> 1239<li>Arithmetic for <tt>complex</tt> numbers.</li>
1223<li>Passing structs by value to vararg C&nbsp;functions.</li> 1240<li>Passing structs by value to vararg C&nbsp;functions.</li>
1224<li><a href="extensions.html#exceptions">C++ exception interoperability</a> 1241<li><a href="extensions.html#exceptions">C++ exception interoperability</a>