diff options
author | Mike Pall <mike> | 2011-05-17 17:58:26 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-05-17 17:58:26 +0200 |
commit | 3168d9aa5983c2dbdc4c8a26a9e0a4b23fb2d178 (patch) | |
tree | 367cffa9e6e4b585954278fbf031966cd877e489 | |
parent | fb46370e561bb74cca908980531b6092a34cf673 (diff) | |
download | luajit-3168d9aa5983c2dbdc4c8a26a9e0a4b23fb2d178.tar.gz luajit-3168d9aa5983c2dbdc4c8a26a9e0a4b23fb2d178.tar.bz2 luajit-3168d9aa5983c2dbdc4c8a26a9e0a4b23fb2d178.zip |
Clarify docs wrt. table initializer handling for VLA/VLS.
-rw-r--r-- | doc/ext_ffi_semantics.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index 624f9efe..56ea58b2 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html | |||
@@ -506,6 +506,11 @@ with the consecutive table elements, starting at either index | |||
506 | all the remaining elements. Otherwise all remaining uninitialized | 506 | all the remaining elements. Otherwise all remaining uninitialized |
507 | elements are filled with zero bytes.</li> | 507 | elements are filled with zero bytes.</li> |
508 | 508 | ||
509 | <li>The above logic only applies to arrays with a known fixed size. | ||
510 | A VLA is only initialized with the element(s) given in the table. | ||
511 | Depending on the use case, you may need to explicitly add a | ||
512 | <tt>NULL</tt> or <tt>0</tt> terminator to a VLA.</li> | ||
513 | |||
509 | <li>If the table has a non-empty hash part, a | 514 | <li>If the table has a non-empty hash part, a |
510 | <tt>struct</tt>/<tt>union</tt> is initialized by looking up each field | 515 | <tt>struct</tt>/<tt>union</tt> is initialized by looking up each field |
511 | name (as a string key) in the table. Each non-<tt>nil</tt> value is | 516 | name (as a string key) in the table. Each non-<tt>nil</tt> value is |
@@ -518,7 +523,7 @@ or <tt>[1]</tt>. This process stops at the first <tt>nil</tt> table | |||
518 | element.</li> | 523 | element.</li> |
519 | 524 | ||
520 | <li>Uninitialized fields of a <tt>struct</tt> are filled with zero | 525 | <li>Uninitialized fields of a <tt>struct</tt> are filled with zero |
521 | bytes.</li> | 526 | bytes, except for the trailing VLA of a VLS.</li> |
522 | 527 | ||
523 | <li>Initialization of a <tt>union</tt> stops after one field has been | 528 | <li>Initialization of a <tt>union</tt> stops after one field has been |
524 | initialized. If no field has been initialized, the <tt>union</tt> is | 529 | initialized. If no field has been initialized, the <tt>union</tt> is |