diff options
author | 2019-12-17 13:23:15 -0800 | |
---|---|---|
committer | 2019-12-17 13:23:15 -0800 | |
commit | c7cf71618071933eac2c18471427d30e6a630af5 (patch) | |
tree | eb467f28b5bc5b60c427cea7675d08d487301969 /tests/test_bytes_vec_alloc.rs | |
parent | 8ae3bb2104fda9a02d55ac5635974ca1b5a49ebb (diff) | |
download | bytes-c7cf71618071933eac2c18471427d30e6a630af5.tar.gz bytes-c7cf71618071933eac2c18471427d30e6a630af5.tar.zst bytes-c7cf71618071933eac2c18471427d30e6a630af5.zip |
Fix Bytes when Vec pointer's LSB is set (#346)
This separates the `SharedVtable` into 3:
- `PromotableEvenVtable`: The original `SharedVtable`, which will
promote the `Vec` to `Shared` on the first clone, and is selected when
the `Vec`'s pointer has the LSB unset.
- `PromotableOddVtable`: Similar to the `PromotableEvenVtable`, but
selected when the `Vec`'s pointer has the LSB set. This vtable differs
in the masking used when reconstructing the `Vec`.
- `SharedVtable`: This no longer checks if its current kind is `VEC` or
`ARC`, and is only created by the "promotable" vtables.
This also adds a test using an "odd" global allocator that purposefully
bumps all pointers with alignment of 1.
Closes #343
Diffstat (limited to 'tests/test_bytes_vec_alloc.rs')
0 files changed, 0 insertions, 0 deletions