| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This enables padding to be computed when packing a custom type and enables zero-copy unpacking by aligning primitives correctly
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This enables padding to be computed when packing a custom type and enables zero-copy unpacking by aligning primitives correctly. The code in test_default demonstrates correct padding for arrays.
This is motivated by passing NumPy's ndarrays with their raw data in bin format to a web frontend where TypedArrays must be correctly aligned otherwise a copy must be taken by slicing the underlying ArrayBuffer (in the @msgpack/msgpack package). Note, the Javascript library gives access to the encoder context for extension types but this is not available for this Python library.