Rustic.Memory 0.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rustic.Memory --version 0.4.1
NuGet\Install-Package Rustic.Memory -Version 0.4.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rustic.Memory" Version="0.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rustic.Memory --version 0.4.1
#r "nuget: Rustic.Memory, 0.4.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rustic.Memory as a Cake Addin
#addin nuget:?package=Rustic.Memory&version=0.4.1

// Install Rustic.Memory as a Cake Tool
#tool nuget:?package=Rustic.Memory&version=0.4.1

Rustic

Common

dotnet add package Rustic.Common

Namespace Rustic.Common

Definition Description
ref struct StrBuilder ValueStringBuilder from ValueStringBuilder: a stack-based string-builder.
static class ThrowHelper Centralized functionality related to validation and throwing exceptions.
static class Arithmetic Collection of extension methods and utility functions related to integer arithmetic. Most functions are ported from bithacks

Memory

dotnet add package Rustic.Memory

Namespace Rustic.Memory

Definition Description
struct TinyVec Read-only list with a inline capacity of 4. Also see TinySpan
readonly ref struct TinySpan Partially inlined immutable collection of function parameters.
readonly ref struct BitSet Enables unaligned marking of bits in a memory area.
readonly ref struct BitVec Partially inlined immutable collection of function parameters.

Vector

Namespace Rustic.Memory.Vector

This package mainly contains the list and buffer implementations

Definition Description
class Vec System.Collections.Generic.List-like implementation allowing by-ref access.
ref struct RefVec Temporary array allocating from ArrayPool<T>.Default.

that aim to optimize memory management, by

  • returning structs by-ref or -readonly ref on access,
  • optimizing for temporary array usage by providing implementations allowing allocation from a ArrayPool<T>,
  • and inlining tiny arrays.

IO

Namespace Rustic.Memory.IO

For constructing or writing sequences of data an array is often required. Therefore, a List<T> has to be copied to the required layout, to circumvent this BufWriter allows moving the reference of the internal array to user control safely.

Definition Description
class BufWriter IBufferWriter similar to Vec.
class PoolBufWriter IBufferWriter similar to PoolVec.

var obj = [...]
PoolBufWriter<byte> writer = new();
Serializer.Serialize(writer, obj);
DoWork(writer.ToSpan(out byte[] poolArray));
ArrayPool<byte>.Return(poolArray);

-- or --

var obj = [...]
PoolBufWriter<byte> writer = new();
Serializer.Serialize(writer, obj);
return writer.ToArray(dispose: true);

Text

dotnet add package Rustic.Text

Namespace Rustic.Text

In addition to that the package provides the following non-allocating helpers for parsing text and more

Definition Description
ref struct SplitIter Iterator slicing a sequence of elements into smaller sequences, by a set of separators. Analogous in function to string.Split
ref struct Tokenizer Allows scanning and navigating a sequence of elements on a per-iteration basis. Inspired by Utf8JsonReader but much more generic.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Rustic.Memory:

Package Downloads
Rustic.Text

Types and extensions improving string access and formatting functionality. Formatter, SeqSplitIter, SplitIter, Tokenizer

Rustic.Reflect

Il based delegate emitter and commonly used reflection utility. ILEmitter, ILReflect

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.6.4 272 7/5/2023
0.6.3 218 5/18/2023
0.6.2 204 5/18/2023
0.6.1 535 1/27/2023
0.6.0 505 1/27/2023
0.5.80 977 2/15/2022
0.5.0 3,310 2/11/2022
0.4.1 650 1/28/2022
0.4.0 658 1/28/2022

# Version 0.4.1

- Validate null checks
- Use branchless Max
- Add test cases for BufWriterTests

# Version 0.4.0

- Rename project root.
- Enforce horizontal separation between projects.
- Create `BitVec`.

# Version 0.3.0

## Major fixes
- Fixed bogus `ArrayPool` usage
- Fix `SplitIter` includes separator. Is not optional
- Change project structure and naming. Notably: `ValueList` → `RefVec`, `RefList` → `Vec`, `ParamSpan` → `TinySpan` and others.

## Minor fixes
- Remove bogus extension-method overloads.
- More & better documentation.