Conversation
The `abomonation` crate allows transmutation of types into buffers of memory and back again. This is useful for caches, where it makes it possible to serve read-only references of the item directly out of the cache memory. The `abomonation` crate implements support for normal vectors. This change adds a new feature (`abomonation`) to the smallvec crate which provides abomonation support for `SmallVec`, too.
|
As an alternative, I've also written TimelyDataflow/abomonation#45 which adds the implementation to the |
|
I'm fine either way, but if you think that putting the code in |
|
To follow up on this - I ended up trying to remove our usage of abomonation and replace it with bincode instead, as bincode 2.0 can perform roughly as well as abomonation if suitably optimized. However, you'll need to implement the new bincode |
|
☔ The latest upstream changes (presumably #298) made this pull request unmergeable. Please resolve the merge conflicts. |
|
(This was auto-closed because the |
The Abomonation crate allows transmutation of types into buffers of memory and back again. This is useful for caches, where it makes it possible to serve read-only references of the item directly out of the cache memory.
Abomonation implements support for normal vectors, however it needs each type to implement the
Abomonationtrait in order for it to work on them. We have structures containing smallvecs that we'd like to serialize with Abomonation, but currently can't as it doesn't implement the trait.This change adds a new feature (
abomonation) to the smallvec crate which provides abomonation support forSmallVecif specified. The implementation is based on the AbomonationVecimplementation, with the unspilled special case accounted for: the data is inline, so doesn't need to be stored separately.I've put this behind a feature flag as I'm sure most users won't want it. However we might not be the only ones using both SmallVec and Abomonation, so I thought I'd share it to see if there is interest in incorporating it here.