https://github.com/libsugar/bettercollections
Some better collection implementations than the system library
https://github.com/libsugar/bettercollections
arraypool collections concurrent data-structures vector
Last synced: about 1 month ago
JSON representation
Some better collection implementations than the system library
- Host: GitHub
- URL: https://github.com/libsugar/bettercollections
- Owner: libsugar
- License: mit
- Created: 2023-11-29T14:46:01.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-29T11:16:13.000Z (about 1 year ago)
- Last Synced: 2025-03-21T10:53:45.616Z (2 months ago)
- Topics: arraypool, collections, concurrent, data-structures, vector
- Language: C#
- Homepage: https://www.nuget.org/packages/BetterCollections/
- Size: 137 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BetterCollections
[](https://github.com/libsugar/BetterCollections/actions/workflows/dotnet.yml)
[](https://www.nuget.org/packages/BetterCollections/)

[](https://libsugar.github.io/BetterCollections/)### WIP
- All containers optionally use ArrayPool
- Buffers
- `DirectAllocationArrayPool`
Pretend to have pooling
- `ArrayPoolFactory`
Factory abstraction provides array pool implementation
- Not Sync / Non Concurrent / No Thread Safe
- `Vec`
Reimplemented `List`, can unsafely retrieve the internal Array or as Span, Memory
*todo* methods same to `List`
- Sync / Concurrent / Thread safe
- `OnceInit`
Similar to `Lazy`, but provides init function when getting
Inspired by rust `OnceCell`
- Memories
- `Box` `ReadOnlyBox`
Simply wrap a value onto the heap
- `ArrayRef` `ReadOnlyArrayRef`
A **fat reference** *(`T[] + offset`)* that can be safely put on the **heap**, not a ref struct
- `MemoryRef` `ReadOnlyMemoryRef`
A **fat reference** *(`Memory + offset`)* that can be safely put on the **heap**, not a ref struct
- `OffsetRef` `ReadOnlyOffsetRef`
A **fat reference** *(`object + offset`)* that can be safely put on the **heap**, not a ref struct
- `MemoryEx`
- Provides `GetEnumerator` for `Memory` `ReadOnlyMemory`
- Cryptography
- `AHasher`
A hasher that ensures even distribution of each bit
If possible use Aes SIMD acceleration (.net7+)
Algorithm from https://github.com/tkaitchuck/aHash