NativeCollectionsCS 1.0.1
dotnet add package NativeCollectionsCS --version 1.0.1
NuGet\Install-Package NativeCollectionsCS -Version 1.0.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="NativeCollectionsCS" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NativeCollectionsCS" Version="1.0.1" />
<PackageReference Include="NativeCollectionsCS" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NativeCollectionsCS --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NativeCollectionsCS, 1.0.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.
#:package NativeCollectionsCS@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NativeCollectionsCS&version=1.0.1
#tool nuget:?package=NativeCollectionsCS&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Native Collections
A performant, GC-free native collection library for C#, optimized for modern .NET applications.
How to use
Namespace
using BenScr.Collections.Native;
NativeArray
using var array = new NativeArray<int>(10);
for (int i = 0; i < array.Length; i++)
array[i] = i * 2;
Console.WriteLine(array[5]); // 10
NativeList
using var list = new NativeList<int>(4);
list.Add(10);
list.Add(20);
list.Add(30);
foreach (var value in list)
Console.WriteLine(value); // 10, 20, 30
NativeQueue
using var queue = new NativeQueue(4);
queue.Enqueue(5);
queue.Enqueue(10);
Console.WriteLine(queue.Dequeue()); // 5
Console.WriteLine(queue.Dequeue()); // 10
NativeDictionary
using var dict = new NativeDictionary(8);
dict.Add(1, 100);
dict[2] = 200; // insert/update
if (dict.TryGetValue(2, out var value))
Console.WriteLine(value); // 200
foreach (var kv in dict)
Console.WriteLine($"{kv.Key} => {kv.Value}");
NativeBitArray
using var bits = new NativeBitArray(32);
bits[0] = true;
bits[5] = true;
bits.SetBit(10);
Console.WriteLine(bits[0]); // True
Console.WriteLine(bits[3]); // False
bits.SetAll(false);
Support
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on NativeCollectionsCS:
| Package | Downloads |
|---|---|
|
UtilityCS
A Wide Range C# Utility Library |
GitHub repositories
This package is not used by any popular GitHub repositories.