diff options
author | Mike Pall <mike> | 2012-08-27 20:52:15 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-08-27 20:53:37 +0200 |
commit | c7826af5a0403b48eeeb6c18532dc076146b1966 (patch) | |
tree | b5f1e86268e3e4ab49d3bb4c8044a9efd61d322f /doc/ext_ffi_semantics.html | |
parent | 76b18b2b465532e528af2162e79365794c8ba290 (diff) | |
download | luajit2-c7826af5a0403b48eeeb6c18532dc076146b1966.tar.gz |
FFI: Detect type punning through unions.
Diffstat (limited to 'doc/ext_ffi_semantics.html')
-rw-r--r-- | doc/ext_ffi_semantics.html | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index afe7e613..56b3f62e 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html @@ -192,8 +192,8 @@ a <tt>typedef</tt>, except re-declarations will be ignored): </ul> <p> -You're encouraged to use these types in preference to the -compiler-specific extensions or the target-dependent standard types. +You're encouraged to use these types in preference to +compiler-specific extensions or target-dependent standard types. E.g. <tt>char</tt> differs in signedness and <tt>long</tt> differs in size, depending on the target architecture and platform ABI. </p> @@ -660,12 +660,18 @@ initialization. The JIT compiler benefits from this fact when applying certain optimizations. </p> <p> -As a consequence of this, the <em>elements</em> of complex numbers and +As a consequence, the <em>elements</em> of complex numbers and vectors are immutable. But the elements of an aggregate holding these types <em>may</em> be modified of course. I.e. you cannot assign to <tt>foo.c.im</tt>, but you can assign a (newly created) complex number to <tt>foo.c</tt>. </p> +<p> +The JIT compiler implements strict aliasing rules: accesses to different +types do <b>not</b> alias, except for differences in signedness (this +applies even to <tt>char</tt> pointers, unlike C99). Type punning +through unions is explicitly detected and allowed. +</p> <h3 id="cdata_call">Calling a cdata object</h3> <ul> |