aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/ext_ffi_semantics.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html
index 5ba82a1e..b56e57a1 100644
--- a/doc/ext_ffi_semantics.html
+++ b/doc/ext_ffi_semantics.html
@@ -440,6 +440,19 @@ If you don't do this, the default Lua number &rarr; <tt>double</tt>
440conversion rule applies. A vararg C&nbsp;function expecting an integer 440conversion rule applies. A vararg C&nbsp;function expecting an integer
441will see a garbled or uninitialized value. 441will see a garbled or uninitialized value.
442</p> 442</p>
443<p>
444Note: this is the only place where creating a boxed scalar number type is
445actually useful. <b>Never use <tt>ffi.new("int")</tt>, <tt>ffi.new("float")</tt>
446etc. anywhere else!</b>
447</p>
448<p style="font-size: 8pt;">
449Ditto for <tt>ffi.cast()</tt>. Explicitly boxing scalars <b>does not</b>
450improve performance or force <tt>int</tt> or <tt>float</tt> arithmetic! It
451just adds costly boxing, unboxing and conversions steps. And it may lead
452to surprise results, because
453<a href="#cdata_arith">cdata arithmetic on scalar numbers</a>
454is always performed on 64 bit integers.
455</p>
443 456
444<h2 id="init">Initializers</h2> 457<h2 id="init">Initializers</h2>
445<p> 458<p>