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 → double conversion rule applies. A vararg C function expecting an integer will see a garbled or uninitialized value.
++Note: this is the only place where creating a boxed scalar number type is +actually useful. Never use ffi.new("int"), ffi.new("float") +etc. anywhere else! +
++Ditto for ffi.cast(). Explicitly boxing scalars does not +improve performance or force int or float arithmetic! It +just adds costly boxing, unboxing and conversions steps. And it may lead +to surprise results, because +cdata arithmetic on scalar numbers +is always performed on 64 bit integers. +