Skip to content

Releases: bluk/gen_value

v0.7.0

29 Sep 17:53
v0.7.0
11f8ee5
Compare
Choose a tag to compare

Added

  • Add UnmanagedGenVec::set_gen() to set the generation for an index.

    Allow directly setting the generation in extreme cases. The method
    should not be used except in edge cases where an index has exhausted
    all generations and all generational indexes have been dropped.

  • Set Minimum Supported Rust Version (MSRV) to 1.56.0

Updated

  • Separate benchmark code into separate crate

Removed

  • Remove thiserror dependency and implement Error trait directly

v0.6.0

27 Apr 15:17
v0.6.0
9669074
Compare
Choose a tag to compare

Updated

  • Use usize index for get_unchecked*

    For performance reasons, change the get_unchecked* methods to use a
    direct usize. Removes the need to pass in the entire generational
    index and call the Into::into(). The assumption is that the
    caller can get the index from the generational index into a usize.

    There may be multiple vectors which may need to be indexed using the
    same index, so avoid having to possibly convert the generational index
    into a usize index multiple times.

    In the worst case, the get_unchecked* method can be added via a trait
    which has a generational index parameter and pass the usize index into
    the get_unchecked* method.

v0.5.0

18 Apr 15:53
v0.5.0
0b8c9a4
Compare
Choose a tag to compare

Updated

  • Rename UnmanagedGenVec::set_gen to set_next_gen

    Panic if set_next_gen is called with more than next gen

    UnmanagedGenVec.set_next_gen() must be called with the next generation of
    the generational index. It is a logical error to call with generations
    further ahead.

    The method can only set the generation to the next generation so
    rename the method to better reflect the intent and capability.

  • Rename UnmanagedGenVec::push to push_with_gen

    Add push() with default generation

  • Panic on remove with last generation

    For a managed indexes GenVec, the last generation is a tombstone
    value which should never be returned. However, if the value were
    manually constructed and used with remove, the method should panic to
    indicate the program logic is incorrect because the value will remain
    accessible

  • Use usize for default generation type

    Due to using a usize for the index type, using a smaller type for the
    generation does not result in any memory savings (unless the
    generational index type uses something besides the default (I, G)
    tuple in a packed or space savings encoding).
    Generally to save space, both the Index type and the Generation type
    must be considered together so default to "expected" behavior while
    callers can still customize behavior for their needs.

v0.4.0

16 Apr 05:24
v0.4.0
6959523
Compare
Choose a tag to compare

Updated

  • Only allow set if the generations are equal

    The generation in the Vec should always be the greatest generation
    used. A generational index with a greater generation is
    invalid. While it could be allowed, skipping generations should
    be considered a logic bug because it wastes generations.

    IndexMut implementations are added for GenVec and UnmanagedGenVec.

  • Fix inconsistent error/panic in set vs set_or_push

    If the index is out of bounds when calling set_or_push,
    an error is returned instead of panicing.

  • Fix default GenIndex type for UnmanagedGenVec

    Type parameter specified (usize, u16) but should have been (I, G)
    in case G or I is specified and they do not match the defaults.

v0.3.0

15 Apr 17:49
v0.3.0
3f1a03f
Compare
Choose a tag to compare

Updated

  • Use the maximum generation value as a tombstone value to indicate an index
    can no longer be accessed or used. Add Incremental::max and changes
    to Allocator::dealloc.

v0.2.0

15 Apr 04:23
v0.2.0
36822be
Compare
Choose a tag to compare

Updated

  • Added type parameters to UnmanagedGenVec for the index I and the
    generational index type GenIndex. Adding the types constrains the
    generational index to one type improving overall safety at the cost
    of some flexibility.
  • Renamed Index type parameter in GenVec to GenIndex.

v0.1.0

15 Apr 02:00
v0.1.0
e5e3194
Compare
Choose a tag to compare

Added

  • Initial release