bytemuck/derive
Christopher Serr 7311e9b4b8
Implement ByteEq and ByteHash derives (#144)
* Implement `ByteEq` and `ByteHash` derives

This adds the derives `ByteEq` and `ByteHash` that can be used as an
alternative to the `Eq` / `PartialEq` and `Hash` derives from the
standard library. The difference is that these variants use `bytemuck`
to convert their values to byte slices before comparing / hashing them.
This allows the comparisons to turn into a simple `memcmp` / `bcmp` (or
completely inlined as a few vector instructions) and allows hashers to
process all bytes at once, possibly allowing for some vector operations
as well.

Here's a quick comparison of the generated assembly:
![https://i.imgur.com/CGTSWTZ.png](https://i.imgur.com/CGTSWTZ.png)

* Address review comments
2022-11-17 13:13:24 -07:00
..
src Implement ByteEq and ByteHash derives (#144) 2022-11-17 13:13:24 -07:00
tests Allow repr(transparent) to be used generically in derive(Pod) (#139) 2022-11-03 07:53:01 -06:00
Cargo.toml (cargo-release) version 1.3.0 2022-11-05 15:49:51 -06:00
changelog.md changelog. 2022-11-05 15:48:37 -06:00
LICENSE-APACHE Replace LICENCES-* symlinks with a licence copy. (#118) 2022-07-13 06:53:17 -06:00
LICENSE-MIT Replace LICENCES-* symlinks with a licence copy. (#118) 2022-07-13 06:53:17 -06:00
LICENSE-ZLIB Replace LICENCES-* symlinks with a licence copy. (#118) 2022-07-13 06:53:17 -06:00
README.md bytemuck_derive: readme 2020-08-20 19:46:22 -06:00

bytemuck_derive

Derive macros for bytemuck traits.