summaryrefslogtreecommitdiff
path: root/doc/ext_ffi_api.html
diff options
context:
space:
mode:
authorMike Pall <mike>2011-01-23 14:23:21 +0100
committerMike Pall <mike>2011-01-23 14:23:21 +0100
commit72b3fff72f6bb9cf5796bbcd50e9a490d4e02b4b (patch)
tree5ee063bd3f5af95dddda47f30c67adfe5bc0e5ad /doc/ext_ffi_api.html
parentf529d22869429d458c5382cf6787f213d7bd5296 (diff)
downloadluajit-72b3fff72f6bb9cf5796bbcd50e9a490d4e02b4b.tar.gz
luajit-72b3fff72f6bb9cf5796bbcd50e9a490d4e02b4b.tar.bz2
luajit-72b3fff72f6bb9cf5796bbcd50e9a490d4e02b4b.zip
FFI: Simplify initializer rules. Clarify docs.
Diffstat (limited to 'doc/ext_ffi_api.html')
-rw-r--r--doc/ext_ffi_api.html25
1 files changed, 6 insertions, 19 deletions
diff --git a/doc/ext_ffi_api.html b/doc/ext_ffi_api.html
index f985d965..f0c4de90 100644
--- a/doc/ext_ffi_api.html
+++ b/doc/ext_ffi_api.html
@@ -195,23 +195,10 @@ require the <tt>nelem</tt> argument. The second syntax uses a ctype as
195a constructor and is otherwise fully equivalent. 195a constructor and is otherwise fully equivalent.
196</p> 196</p>
197<p> 197<p>
198The <tt>init</tt> arguments provide optional initializers. The created 198The cdata object is initialized according to the
199cdata object is filled with zero bytes if no initializers are given. 199<a href="ext_ffi_semantics.html#init">rules for initializers</a>,
200Scalar types accept a single initializer. Aggregates can either be 200using the optional <tt>init</tt> arguments. Excess initializers cause
201initialized with a flat list of initializers or a single aggregate 201an error.
202initializer (see the <a href="ext_ffi_semantics.html#convert">C&nbsp;type
203conversion rules</a>). Excess initializers cause an error.
204</p>
205<p>
206If a single initializer is given for an array, it's repeated for all
207remaining elements. This doesn't happen if two or more initializers
208are given &mdash; all uninitialized elements are filled with zero
209bytes. The fields of a <tt>struct</tt> are initialized in the order of
210their declaration. Uninitialized fields are filled with zero bytes.
211Only the first field of <tt>union</tt> can be initialized with a flat
212initializer. Elements or fields which are aggregates themselves are
213initialized with a <em>single</em> <tt>init</tt> argument, but this
214may be an aggregate initializer of course.
215</p> 202</p>
216<p> 203<p>
217Performance notice: if you want to create many objects of one kind, 204Performance notice: if you want to create many objects of one kind,
@@ -357,8 +344,8 @@ order of arguments!
357<h3 id="ffi_abi"><tt>status = ffi.abi(param)</tt></h3> 344<h3 id="ffi_abi"><tt>status = ffi.abi(param)</tt></h3>
358<p> 345<p>
359Returns <tt>true</tt> if <tt>param</tt> (a Lua string) applies for the 346Returns <tt>true</tt> if <tt>param</tt> (a Lua string) applies for the
360target ABI (Application Binary Interface). Otherwise returns 347target ABI (Application Binary Interface). Returns <tt>false</tt>
361<tt>false</tt>. The following parameters are currently defined: 348otherwise. The following parameters are currently defined:
362</p> 349</p>
363<table class="abitable"> 350<table class="abitable">
364<tr class="abihead"> 351<tr class="abihead">