aboutsummaryrefslogtreecommitdiff
path: root/doc/ext_buffer.html
diff options
context:
space:
mode:
authorMike Pall <mike>2022-06-23 09:10:43 +0200
committerMike Pall <mike>2022-06-23 09:10:43 +0200
commit4c2441c16ce3c4e312aaefecc6d40c4fe21de97c (patch)
tree0ee5ad7a3246f9a620265de9c6998308cb44a09b /doc/ext_buffer.html
parent0065cff7e0222c234b75a71e72b8883df5d000c2 (diff)
parent2e98c3d0644fc0c265844908f43b7e4526dd819c (diff)
downloadluajit-4c2441c16ce3c4e312aaefecc6d40c4fe21de97c.tar.gz
luajit-4c2441c16ce3c4e312aaefecc6d40c4fe21de97c.tar.bz2
luajit-4c2441c16ce3c4e312aaefecc6d40c4fe21de97c.zip
Merge branch 'master' into v2.1
Diffstat (limited to 'doc/ext_buffer.html')
-rw-r--r--doc/ext_buffer.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/ext_buffer.html b/doc/ext_buffer.html
index 7b874f57..192110a7 100644
--- a/doc/ext_buffer.html
+++ b/doc/ext_buffer.html
@@ -86,7 +86,7 @@ overhead. In conjunction with the FFI library, they allow zero-copy
86operations. 86operations.
87</p> 87</p>
88<p> 88<p>
89The string buffer libary also includes a high-performance 89The string buffer library also includes a high-performance
90<a href="serialize">serializer</a> for Lua objects. 90<a href="serialize">serializer</a> for Lua objects.
91</p> 91</p>
92 92
@@ -434,8 +434,8 @@ unsupported object types, circular references or deeply nested tables.
434<h3 id="buffer_decode"><tt>obj = buffer.decode(str)<br> 434<h3 id="buffer_decode"><tt>obj = buffer.decode(str)<br>
435obj = buf:decode()</tt></h3> 435obj = buf:decode()</tt></h3>
436<p> 436<p>
437The stand-alone function de-serializes (decodes) the string 437The stand-alone function deserializes (decodes) the string
438<tt>str</tt>, the buffer method de-serializes one object from the 438<tt>str</tt>, the buffer method deserializes one object from the
439buffer. Both return a Lua object <tt>obj</tt>. 439buffer. Both return a Lua object <tt>obj</tt>.
440</p> 440</p>
441<p> 441<p>
@@ -449,7 +449,7 @@ data after decoding a single top-level object. The buffer method leaves
449any left-over data in the buffer. 449any left-over data in the buffer.
450</p> 450</p>
451<p> 451<p>
452Attempting to de-serialize an FFI type will throw an error, if the FFI 452Attempting to deserialize an FFI type will throw an error, if the FFI
453library is not built-in or has not been loaded, yet. 453library is not built-in or has not been loaded, yet.
454</p> 454</p>
455 455
@@ -462,7 +462,7 @@ the following members (all optional):
462<li> 462<li>
463<tt>dict</tt> is a Lua table holding a <b>dictionary of strings</b> that 463<tt>dict</tt> is a Lua table holding a <b>dictionary of strings</b> that
464commonly occur as table keys of objects you are serializing. These keys 464commonly occur as table keys of objects you are serializing. These keys
465are compactly encoded as indexes during serialization. A well chosen 465are compactly encoded as indexes during serialization. A well-chosen
466dictionary saves space and improves serialization performance. 466dictionary saves space and improves serialization performance.
467</li> 467</li>
468<li> 468<li>
@@ -473,7 +473,7 @@ for the table objects you are serializing.
473<p> 473<p>
474<tt>dict</tt> needs to be an array of strings and <tt>metatable</tt> needs 474<tt>dict</tt> needs to be an array of strings and <tt>metatable</tt> needs
475to be an array of tables. Both starting at index 1 and without holes (no 475to be an array of tables. Both starting at index 1 and without holes (no
476<tt>nil</tt> inbetween). The tables are anchored in the buffer object and 476<tt>nil</tt> in between). The tables are anchored in the buffer object and
477internally modified into a two-way index (don't do this yourself, just pass 477internally modified into a two-way index (don't do this yourself, just pass
478a plain array). The tables must not be modified after they have been passed 478a plain array). The tables must not be modified after they have been passed
479to <tt>buffer.new()</tt>. 479to <tt>buffer.new()</tt>.
@@ -624,7 +624,7 @@ errors are best caught with an outer wrapper for larger parts of code.
624There's not much one can do after that, anyway. 624There's not much one can do after that, anyway.
625</p> 625</p>
626<p> 626<p>
627OTOH you may want to catch some errors individually. Buffer methods need 627OTOH, you may want to catch some errors individually. Buffer methods need
628to receive the buffer object as the first argument. The Lua colon-syntax 628to receive the buffer object as the first argument. The Lua colon-syntax
629<tt>obj:method()</tt> does that implicitly. But to wrap a method with 629<tt>obj:method()</tt> does that implicitly. But to wrap a method with
630<tt>pcall()</tt>, the arguments need to be passed like this: 630<tt>pcall()</tt>, the arguments need to be passed like this: