diff options
author | Mike Pall <mike> | 2022-06-23 09:10:43 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2022-06-23 09:10:43 +0200 |
commit | 4c2441c16ce3c4e312aaefecc6d40c4fe21de97c (patch) | |
tree | 0ee5ad7a3246f9a620265de9c6998308cb44a09b /doc/ext_buffer.html | |
parent | 0065cff7e0222c234b75a71e72b8883df5d000c2 (diff) | |
parent | 2e98c3d0644fc0c265844908f43b7e4526dd819c (diff) | |
download | luajit-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.html | 14 |
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 | |||
86 | operations. | 86 | operations. |
87 | </p> | 87 | </p> |
88 | <p> | 88 | <p> |
89 | The string buffer libary also includes a high-performance | 89 | The 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> |
435 | obj = buf:decode()</tt></h3> | 435 | obj = buf:decode()</tt></h3> |
436 | <p> | 436 | <p> |
437 | The stand-alone function de-serializes (decodes) the string | 437 | The 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 |
439 | buffer. Both return a Lua object <tt>obj</tt>. | 439 | buffer. 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 | |||
449 | any left-over data in the buffer. | 449 | any left-over data in the buffer. |
450 | </p> | 450 | </p> |
451 | <p> | 451 | <p> |
452 | Attempting to de-serialize an FFI type will throw an error, if the FFI | 452 | Attempting to deserialize an FFI type will throw an error, if the FFI |
453 | library is not built-in or has not been loaded, yet. | 453 | library 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 |
464 | commonly occur as table keys of objects you are serializing. These keys | 464 | commonly occur as table keys of objects you are serializing. These keys |
465 | are compactly encoded as indexes during serialization. A well chosen | 465 | are compactly encoded as indexes during serialization. A well-chosen |
466 | dictionary saves space and improves serialization performance. | 466 | dictionary 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 |
475 | to be an array of tables. Both starting at index 1 and without holes (no | 475 | to 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 |
477 | internally modified into a two-way index (don't do this yourself, just pass | 477 | internally modified into a two-way index (don't do this yourself, just pass |
478 | a plain array). The tables must not be modified after they have been passed | 478 | a plain array). The tables must not be modified after they have been passed |
479 | to <tt>buffer.new()</tt>. | 479 | to <tt>buffer.new()</tt>. |
@@ -624,7 +624,7 @@ errors are best caught with an outer wrapper for larger parts of code. | |||
624 | There's not much one can do after that, anyway. | 624 | There's not much one can do after that, anyway. |
625 | </p> | 625 | </p> |
626 | <p> | 626 | <p> |
627 | OTOH you may want to catch some errors individually. Buffer methods need | 627 | OTOH, you may want to catch some errors individually. Buffer methods need |
628 | to receive the buffer object as the first argument. The Lua colon-syntax | 628 | to 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: |