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.
1.3.1 - 2021-02-19
- Fixed double destruction of elements in the
SliceMoveSource::move_elements
andSliceMoveSourceCollection::move_all_elements
implementations for arrays and boxed slices when unwinding as the result of a panic in the provided closure ([#1][]).
1.3.0 - 2019-07-21
- Stable toolchain
alloc
crate support forno_std
code via thealloc
feature. This requires Rust 1.36 or later. ByteData
support forstd::mem::MaybeUninit
types that wrap otherByteData
types (e.g.MaybeUninit<usize>
) when using Rust 1.36 or later or when theunstable
feature is enabled.
- Add
local_inner_macros
modifier to utility macro declarations (array_type_for_bytes!
,cache_aligned_zeroed_for_markers!
, etc.), allowing them to be imported individually viause
statements in Rust 2018 code without needing to import any other macros that they may call. - Update example and test code to use
std::mem::MaybeUninit
as appropriate when working with uninitialized memory. The now-deprecatedstd::mem::uninitialized()
function is only used for tests on legacy systems and is not included in any generated documentation. - Include recommendations to use arrays and slices of
std::mem::MaybeUninit
elements if possible for uninitialized memory storage to the documentation forScratchpad::static_new()
,Scratchpad::static_new_in_place()
,uninitialized_boxed_slice()
,uninitialized_boxed_slice_for_bytes()
, anduninitialized_boxed_slice_for_markers()
, as well as a note in the "Known Issues" section of the crate-level documentation. - Add
#[repr(C)]
attribute toCacheAligned
in order to guarantee consistent data layout.CacheAligned
is correctly sized and aligned in practice with the default Rustrepr
, but the Rustrepr
technically doesn't guarantee any specific data layout; specifying theC
repr
helps us avoid any edge cases that may arise. Existing code should still behave as normal. - Updated Travis CI configuration to use
clippy
andrustfmt
from the stable toolchain, and updated the code accordingly (based on the 1.36.0 toolchain versions). - Various minor API documentation improvements.
1.2.0 - 2018-07-07
CStr
allocation support, including conversion ofCStr
allocations to[u8]
allocations.- Implementation of
StableDeref
forAllocation
, allowing allocations to be used with other crates that support the trait such asowning_ref
andrental
.
- Minor documentation fixes.
1.1.0 - 2018-06-16
Scratchpad::static_new_in_place()
for initializing aScratchpad
within a block of uninitialized memory forScratchpad
types that use only static arrays for backing memory, bypassing potential call stack use for parameters and return values that may exceed the amount of space available on the stack.
1.0.1 - 2018-06-07
- Use unaligned reads and writes in
Tracking::get()
andTracking::set()
implementations forBuffer
types to avoid potential issues with marker tracking buffers that are not aligned to at least the same alignment asusize
, asBuffer
doesn't guarantee any specific alignment, and some CPU architectures do not allow unaligned access. This can impact performance, but retains compatibility with code that may be using tracking buffers with lower alignment requirements.
1.0.0 - 2018-06-04
IntoMutSliceLikePtr
trait for reinterpreting pointer types to compatibleSliceLike
pointers. This replaces theIntoSliceLikeAllocation
trait for determining whichAllocation
types can be converted to slices and slice-like types.- Missing support for converting
str
allocations to[u8]
allocations.
- Moved
into_slice_like_allocation()
away from theIntoSliceLikeAllocation
trait into a method ofAllocation
itself, allowing it to be called directly on any allocation without having to import any special traits. - Rewrote much of the crate-level documentation to be more useful as well as better reflect the changes made since the initial release.
IntoSliceLikeAllocation
trait (superseded byAllocation::into_slice_like_allocation()
andIntoMutSliceLikePtr
trait).
1.0.0-beta.2 - 2018-05-31
SliceSource
trait for providing slice data toMarker
functions from various source data types.SliceMoveSource
subtrait ofSliceSource
that allows for taking ownership of the contents of a slice.SliceSourceCollection
trait for abstracting collections ofSliceSource
objects.SliceMoveSourceCollection
subtrait ofSliceSourceCollection
that allows for taking ownership of the slices provided by allSliceSource
objects in a collection.Marker::concat_slices()
function for concatenating slices by moving their contents into the new allocation.
- Overhauled
Marker
functions that work with slices to take slice input using the newSliceSource
,SliceMoveSource
,SliceSourceCollection
, andSliceMoveSourceCollection
traits, allowing for more flexible input for slice data. Additionally, the inputs for these functions are now more consistent with one another. - Renamed
IntoSliceAllocation
toIntoSliceLikeAllocation
and updated its methods accordingly for consistency with other traits that work withSliceLike
types. - Unconditionally enable
i128
andu128
implementations ofByteData
if therustc
version detected at build time is 1.26 or later.
OwnedSlice
trait (superseded bySliceSource
and its related traits).- Automatic coercion of scalar values (including boxed scalars) and boxed
arrays into slices when used as arguments for
Marker::allocate_slice()
,Marker::extend()
, and the relatedMarkerFront
andMarkerBack
wrappers. Support for scalars previously resulted in ambiguity when trying to determine whether an array or slice reference should be interpreted as a slice of its contents or a single-element slice containing either the array or slice reference, requiring explicit type annotations in such cases. On the other hand, support for boxed arrays simply becomes difficult to implement when using the newly addedArray
trait, so they've simply been removed in response. Both can still be used as input via explicit conversion into a supported type. - Miscellaneous unnecessary generic parameters.
- Check for the correct feature ("unstable" versus "nightly") in the
cfg
attributes used to control whetherByteData
implementations are generated fori128
andu128
.
1.0.0-beta.1 - 2018-05-25
Marker::allocate_slice()
,Marker::allocate_slice_clone()
, andMarker::allocate_slice_copy()
for creating slice allocations.Allocation::concat()
andAllocation::concat_unchecked()
for concatenating two adjacent allocations into a single slice allocation.MarkerFront::append{,_clone,_copy}()
andMarkerBack::prepend{,_clone,_copy}()
for extending existing allocations at the end of their respective stacks with new data. This functionality is also available through theMarker
trait using theextend{,_clone,_copy}()
methods (appending is always performed by front markers, and prepending is always performed by back markers).IntoSliceAllocation
trait for safely coercingAllocation
instances into allocations of slices. This is also used to determine what types can be used for allocation concatenation (concat()
andconcat_unchecked()
allocation methods) and extension (append*()
andprepend*()
marker methods).SliceLike
trait for performing conversions between DSTs that essentially wrap some primitive slice type and the underlying slice type (e.g. betweenstr
and[u8]
), andConcatenateSlice
trait for markingSliceLike
types that can be safely concatenated without any additional verification needed. This is used to allow for general use of such DSTs in allocations.- Various unit tests for edge cases (e.g. allocation extension safety, ZST allocation support).
- Replaced the simple
Error
enum with anError
struct that provides the error category (anErrorKind
enum variant based on the oldError
enum) and any values whose ownership was intended to be passed to the callee. This allows the caller to reuse such values if an operation fails instead of simply throwing them away. - Replaced
Marker::concat()
withMarker::concat_slices_clone()
andMarker::concat_slices_copy()
, which both work on general slices. - Use
NonNull<T>
for internal storage ofAllocation
pointers, allowing for compiler optimizations such as reducingOption<Allocation<'marker, T>>
size to that of a single pointer.
0.3.0 - 2018-04-30
Marker::concat()
for concatenating a series of strings into a single string slice allocated from the marker on which it is called.#[inline]
attribute to mostMarker
allocation functions and theuninitialized_boxed_slice*()
utility functions.
- Replaced data reference in
Allocation
with a raw pointer, allowing the removal of the nebulous't
lifetime in theAllocation
type andMarker
methods (conceptually, anAllocation
instance owns its data, and this helps clarify that ownership).
- Reference to creating static instances of
Scratchpad
from README (overlooked when correcting the crate documentation for version 0.2.0).
0.2.0 - 2018-04-29
Scratchpad::static_new()
function for creating scratchpads backed by static arrays without having to pass array instances as function parameters.StaticBuffer
trait for constrainingScratchpad::static_new()
to scratchpads that use only static arrays for backing storage.cache_aligned_zeroed!()
,cache_aligned_zeroed_for_bytes!()
, andcache_aligned_zeroed_for_markers!()
macros for shorthand creation of zeroed-outCacheAligned
data.- References to
MarkerFront
andMarkerBack
in documentation forMarker
. - Run tests with both the
std
andunstable
crate features enabled in Travis CI configuration. - "data-structures" and "embedded" categories in
Cargo.toml
manifest. - Documentation link in
Cargo.toml
manifest. - Documentation and release nodes links in
README.md
. - Changelog.
- Clarified how the front and back allocation stacks operate independently in documentation.
- Use clearer wording in "Memory Overhead" documentation section.
- Minor documentation tweaks.
- References to creating static instances of
Scratchpad
from documentation (static variables must implementSync
, butScratchpad
is not thread-safe by design).
- Incorrect "deque" term use internally.
- Initial release.