All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Switched to const generics instead of the
typenum
crate. Rust 1.51 or later is required.
- When
InlineArray
cannot hold any values because of misalignment, report it as capacity 0 instead of panicking at runtime. (#22)
InlineArray
can be used in recursive types again.
InlineArray::new()
now panics when it can't store elements with large alignment (this was UB prior to 0.6.3). Alignments ofusize
and smaller are always supported. Larger alignments are supported if the capacity-providing type has sufficient alignment.
- Multilple soundness fixes:
InlineArray
handles large alignment, panic safety inChunk
'sclone
andfrom_iter
, capacity checks inunit()
,pair()
andfrom()
. InlineArray
can now handle zero sized values. This relies on conditionals in const functions, a feature which was introduced in Rust 1.46.0, which means this is now the minimum Rust version this crate will work on.
- This release exists for no other purpose than to bump the
refpool
optional dependency.
- The crate now has a
std
feature flag, which is on by default, and will make the crateno_std
if disabled.
- Fixed a compilation error if you had the
arbitrary
feature flag enabled without theringbuffer
flag.
RingBuffer
and its accompanying slice typesSlice
andSliceMut
now implementArray
andArrayMut
fromarray-ops
, giving them most of the methods that would be available on primitive slice types and cutting down on code duplication in the implementation, but at the price of having to pullArray
et al into scope when you need them. Because this means adding a dependency toarray-ops
,RingBuffer
has now been moved behind theringbuffer
feature flag.Chunk
andInlineArray
don't and won't implementArray
, because they are both able to implementDeref<[A]>
, which provides the same functionality more efficiently.
- The
insert_from
andinsert_ordered
methods recently added toChunk
have now also been added toRingBuffer
. RingBuffer
'sSlice
andSliceMut
now also have the threebinary_search
methods regular slices have.SparseChunk
,RingBuffer
,Slice
andSliceMut
now have unsafeget_unchecked
andget_unchecked_mut
methods.PartialEq
implementations allowing you to compareRingBuffer
s,Slice
s andSliceMut
s interchangeably have been added.
- Fixed an aliasing issue in
RingBuffer
's mutable iterator, as uncovered by Miri. Behind the scenes, the full non-fuzzing unit test suite is now able to run on Miri without crashing it (after migrating the last Proptest tests away from the test suite into the fuzz targets), and this has been included in its CI build. (#6)
- Debug only assertions made it into the previous release by accident, and this change has been reverted. (#7)
Chunk
now has aninsert_from
method for inserting multiple values at an index in one go.Chunk
now also has aninsert_ordered
method for inserting values into a sorted chunk.SparseChunk
now has the methodsoption_iter()
,option_iter_mut()
andoption_drain()
with their corresponding iterators to iterate over a chunk as if it were an array ofOption
s.Arbitrary
implementations for all data types have been added behind thearbitrary
feature flag.
- Internal consistency assertions are now only performed in debug mode (like with
debug_assert!
). This meanssized_chunks
will no longer cause panics in release mode when you do things like pushing to a full chunk, but do bad and undefined things instead. It also means a very slight performance gain.
PoolDefault
andPoolClone
implementations, from therefpool
crate, are available forChunk
,SparseChunk
andRingBuffer
, behind therefpool
feature flag.
- The
Bitmap
type (and its helper type,Bits
) has been split off into a separate crate, namedbitmaps
. If you need it, it's in that crate now.sized-chunks
does not re-export it. Of course, this meanssized-chunks
has gainedbitmaps
as its second hard dependency.
- The 0.3.2 release increased the minimum rustc version required, which should have been a major version bump, so 0.3.2 is being yanked and re-tagged as 0.4.0.
- Chunk/bitmap sizes up to 1024 are now supported.
- Replaced
ManuallyDrop
in implementations withMaybeUninit
, along with a general unsafe code cleanup. (#3)
- Chunk sizes up to 256 are now supported.
- A new data structure,
InlineArray
, which is a stack allocated array matching the size of a given type, intended for optimising for the case of very small vectors. Chunk
has an implementation ofFrom<InlineArray>
which is considerably faster than going via iterators.
Slice::get
methods now return references with the lifetime of the underlyingRingBuffer
rather than the lifetime of the slice.
- A lot of documentation.
std::io::Read
implementations forChunk<u8>
andRingBuffer<u8>
to match theirWrite
implementations.
- The
capacity()
method has been replacied with aCAPACITY
const on each type.
- There is now a
RingBuffer
implementation, which should be nearly a drop-in replacement forSizedChunk
but is always O(1) on push and cannot be dereferenced to slices (but it has a set of custom slice-like implementations to make that less of a drawback). - The
Drain
iterator forSizedChunk
now implementsDoubleEndedIterator
.
SizedChunk::drain_from_front/back
will now always panic if the iterator underflows, instead of only doing it in debug mode.
SparseChunk
now has a default length ofU64
.Chunk
now hasPartialEq
defined for anything that can be borrowed as a slice.SparseChunk<A>
likewise hasPartialEq
defined forBTreeMap<usize, A>
andHashMap<usize, A>
. These are intended for debugging and aren't optimally `efficient.Chunk
andSparseChunk
now have a new methodcapacity()
which returns its maximum capacity (the number in the type) as a usize.- Added an
entries()
method toSparseChunk
. SparseChunk
now has aDebug
implementation.
- Extensive integration tests were added for
Chunk
andSparseChunk
. Chunk::clear
is now very slightly faster.
- Fixed an alignment issue in
Chunk::drain_from_back
. (#1)
- Some 2018 edition issues.
Initial release.