summaryrefslogtreecommitdiff
path: root/doc/ext_ffi_api.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ext_ffi_api.html')
-rw-r--r--doc/ext_ffi_api.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/ext_ffi_api.html b/doc/ext_ffi_api.html
index 5bd4b80c..2b6d1d86 100644
--- a/doc/ext_ffi_api.html
+++ b/doc/ext_ffi_api.html
@@ -238,6 +238,31 @@ This functions is mainly useful to override the pointer compatibility
238checks or to convert pointers to addresses or vice versa. 238checks or to convert pointers to addresses or vice versa.
239</p> 239</p>
240 240
241<h3 id="ffi_metatype"><tt>ctype = ffi.metatype(ct, metatable)</tt></h3>
242<p>
243Creates a ctype object for the given <tt>ct</tt> and associates it with
244a metatable. Only <tt>struct</tt>/<tt>union</tt> types, complex numbers
245and vectors are allowed. Other types may be wrapped in a
246<tt>struct</tt>, if needed.
247</p>
248<p>
249The association with a metatable is permanent and cannot be changed
250afterwards. Neither the contents of the <tt>metatable</tt> nor the
251contents of an <tt>__index</tt> table (if any) may be modified
252afterwards. The associated metatable automatically applies to all uses
253of this type, no matter how the objects are created or where they
254originate from. Note that pre-defined operations on types have
255precedence (e.g. declared field names cannot be overriden).
256</p>
257<p>
258All standard Lua metamethods are implemented. These are called directly,
259without shortcuts and on any mix of types. For binary operations, the
260left operand is checked first for a valid ctype metamethod. The
261<tt>__gc</tt> metamethod only applies to <tt>struct</tt>/<tt>union</tt>
262types and performs an implicit <a href="#ffi_gc"><tt>ffi.gc()</tt></a>
263call during creation of an instance.
264</p>
265
241<h3 id="ffi_gc"><tt>cdata = ffi.gc(cdata, finalizer)</tt></h3> 266<h3 id="ffi_gc"><tt>cdata = ffi.gc(cdata, finalizer)</tt></h3>
242<p> 267<p>
243Associates a finalizer with a pointer or aggregate cdata object. The 268Associates a finalizer with a pointer or aggregate cdata object. The