diff options
Diffstat (limited to 'doc/ext_ffi_semantics.html')
-rw-r--r-- | doc/ext_ffi_semantics.html | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index 4909fedd..d515a142 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html | |||
@@ -1,8 +1,8 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | 1 | <!DOCTYPE html> |
2 | <html> | 2 | <html> |
3 | <head> | 3 | <head> |
4 | <title>FFI Semantics</title> | 4 | <title>FFI Semantics</title> |
5 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | 5 | <meta charset="utf-8"> |
6 | <meta name="Copyright" content="Copyright (C) 2005-2022"> | 6 | <meta name="Copyright" content="Copyright (C) 2005-2022"> |
7 | <meta name="Language" content="en"> | 7 | <meta name="Language" content="en"> |
8 | <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen"> | 8 | <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen"> |
@@ -42,9 +42,13 @@ td.convop { font-style: italic; width: 40%; } | |||
42 | <a class="current" href="ext_ffi_semantics.html">FFI Semantics</a> | 42 | <a class="current" href="ext_ffi_semantics.html">FFI Semantics</a> |
43 | </li></ul> | 43 | </li></ul> |
44 | </li><li> | 44 | </li><li> |
45 | <a href="ext_buffer.html">String Buffers</a> | ||
46 | </li><li> | ||
45 | <a href="ext_jit.html">jit.* Library</a> | 47 | <a href="ext_jit.html">jit.* Library</a> |
46 | </li><li> | 48 | </li><li> |
47 | <a href="ext_c_api.html">Lua/C API</a> | 49 | <a href="ext_c_api.html">Lua/C API</a> |
50 | </li><li> | ||
51 | <a href="ext_profiler.html">Profiler</a> | ||
48 | </li></ul> | 52 | </li></ul> |
49 | </li><li> | 53 | </li><li> |
50 | <a href="status.html">Status</a> | 54 | <a href="status.html">Status</a> |
@@ -177,6 +181,8 @@ a <tt>typedef</tt>, except re-declarations will be ignored): | |||
177 | <tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>, | 181 | <tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>, |
178 | <tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li> | 182 | <tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li> |
179 | 183 | ||
184 | <li>From <tt><unistd.h></tt> (POSIX): <tt>ssize_t</tt>.</li> | ||
185 | |||
180 | </ul> | 186 | </ul> |
181 | <p> | 187 | <p> |
182 | You're encouraged to use these types in preference to | 188 | You're encouraged to use these types in preference to |
@@ -724,6 +730,22 @@ You'll have to explicitly convert a 64 bit integer to a Lua | |||
724 | number (e.g. for regular floating-point calculations) with | 730 | number (e.g. for regular floating-point calculations) with |
725 | <tt>tonumber()</tt>. But note this may incur a precision loss.</li> | 731 | <tt>tonumber()</tt>. But note this may incur a precision loss.</li> |
726 | 732 | ||
733 | <li><b>64 bit bitwise operations</b>: the rules for 64 bit | ||
734 | arithmetic operators apply analogously.<br> | ||
735 | |||
736 | Unlike the other <tt>bit.*</tt> operations, <tt>bit.tobit()</tt> | ||
737 | converts a cdata number via <tt>int64_t</tt> to <tt>int32_t</tt> and | ||
738 | returns a Lua number.<br> | ||
739 | |||
740 | For <tt>bit.band()</tt>, <tt>bit.bor()</tt> and <tt>bit.bxor()</tt>, the | ||
741 | conversion to <tt>int64_t</tt> or <tt>uint64_t</tt> applies to | ||
742 | <em>all</em> arguments, if <em>any</em> argument is a cdata number.<br> | ||
743 | |||
744 | For all other operations, only the first argument is used to determine | ||
745 | the output type. This implies that a cdata number as a shift count for | ||
746 | shifts and rotates is accepted, but that alone does <em>not</em> cause | ||
747 | a cdata number output. | ||
748 | |||
727 | </ul> | 749 | </ul> |
728 | 750 | ||
729 | <h3 id="cdata_comp">Comparisons of cdata objects</h3> | 751 | <h3 id="cdata_comp">Comparisons of cdata objects</h3> |
@@ -1195,14 +1217,12 @@ The following operations are currently not compiled and may exhibit | |||
1195 | suboptimal performance, especially when used in inner loops: | 1217 | suboptimal performance, especially when used in inner loops: |
1196 | </p> | 1218 | </p> |
1197 | <ul> | 1219 | <ul> |
1198 | <li>Bitfield accesses and initializations.</li> | ||
1199 | <li>Vector operations.</li> | 1220 | <li>Vector operations.</li> |
1200 | <li>Table initializers.</li> | 1221 | <li>Table initializers.</li> |
1201 | <li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li> | 1222 | <li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li> |
1202 | <li>Allocations of variable-length arrays or structs.</li> | 1223 | <li>Non-default initialization of VLA/VLS or large C types |
1203 | <li>Allocations of C types with a size > 128 bytes or an | 1224 | (> 128 bytes or > 16 array elements).</li> |
1204 | alignment > 8 bytes.</li> | 1225 | <li>Bitfield initializations.</li> |
1205 | <li>Conversions from lightuserdata to <tt>void *</tt>.</li> | ||
1206 | <li>Pointer differences for element sizes that are not a power of | 1226 | <li>Pointer differences for element sizes that are not a power of |
1207 | two.</li> | 1227 | two.</li> |
1208 | <li>Calls to C functions with aggregates passed or returned by | 1228 | <li>Calls to C functions with aggregates passed or returned by |
@@ -1218,7 +1238,6 @@ value.</li> | |||
1218 | Other missing features: | 1238 | Other missing features: |
1219 | </p> | 1239 | </p> |
1220 | <ul> | 1240 | <ul> |
1221 | <li>Bit operations for 64 bit types.</li> | ||
1222 | <li>Arithmetic for <tt>complex</tt> numbers.</li> | 1241 | <li>Arithmetic for <tt>complex</tt> numbers.</li> |
1223 | <li>Passing structs by value to vararg C functions.</li> | 1242 | <li>Passing structs by value to vararg C functions.</li> |
1224 | <li><a href="extensions.html#exceptions">C++ exception interoperability</a> | 1243 | <li><a href="extensions.html#exceptions">C++ exception interoperability</a> |