Hertzole.ArrayPoolScope
1.0.0
See the version list below for details.
dotnet add package Hertzole.ArrayPoolScope --version 1.0.0
NuGet\Install-Package Hertzole.ArrayPoolScope -Version 1.0.0
<PackageReference Include="Hertzole.ArrayPoolScope" Version="1.0.0" />
paket add Hertzole.ArrayPoolScope --version 1.0.0
#r "nuget: Hertzole.ArrayPoolScope, 1.0.0"
// Install Hertzole.ArrayPoolScope as a Cake Addin #addin nuget:?package=Hertzole.ArrayPoolScope&version=1.0.0 // Install Hertzole.ArrayPoolScope as a Cake Tool #tool nuget:?package=Hertzole.ArrayPoolScope&version=1.0.0
Array Pool Scope
Array Pool Scope allows you to use ArrayPool in a scope-like manner.
💨 Quick Start
using Hertzole.Buffers;
int length = 10;
// Use a using statement to automatically return the array to the pool.
using (ArrayPoolScope<int> pool = new ArrayPoolScope<int>(length))
{
// For loop
for (int i = 0; i < pool.Length; i++)
{
pool.Array[i] = i;
Console.WriteLine(pool.Array[i]);
}
// Foreach loop
foreach (int item in pool)
{
Console.WriteLine(item);
}
}
// Manully return the array to the pool.
ArrayPoolScope<int> pool = new ArrayPoolScope<int>(length);
pool.Dispose();
// Provide your own pool.
ArrayPool<int> customPool = ArrayPool<int>.Create();
using ArrayPoolScope<int> pool = new ArrayPoolScope<int>(length, customPool);
// Get directly from pool
using ArrayPoolScope<int> pool = ArrayPool<int>.RentScope(length);
// As span and memory
using ArrayPoolScope<int> pool = ArrayPool<int>.RentScope(length);
Span<int> span = pool.AsSpan();
Memory<int> memory = pool.AsMemory();
📦 Installation
You can install the package via NuGet. The package supports .NET Standard 2.0 and up.
dotnet add package Hertzole.ArrayPoolScope
Unity Installation
OpenUPM (Recommended)
The minimum Unity version for Array Pool Scope is 2021.3.
You can install the package through OpenUPM by using the OpenUPM CLI.
openupm add se.hertzole.array-pool-scope
If you don't have the CLI installed, you can follow these steps:
- Open Edit/Project Settings/Package Manager
- Add a new Scoped Registry (or edit the existing OpenUPM entry)
Name:package.openupm.com
URL:https://package.openupm.com
Scope:se.hertzole.array-pool-scope
- Click
Save
(orApply
) - Open Window/Package Manager
- Click
+
- Select
Add package by name...
orAdd package from git URL...
- Paste
se.hertzole.array-pool-scope
into name - Click
Add
Unity Package Manager
You can install the package through the Unity Package Manager.
- Open
Window/Package Manager
- Click the
+
in the top left corner - Select
Add package from git URL...
- Paste
https://github.com/Hertzole/array-pool-scope.git#upm
💻 Development
Requirements
For standard .NET development, you need the following:
For Unity development, you need the following:
Building
To build the project, you can use the dotnet
CLI.
dotnet build
Testing
To run the tests, you can use the dotnet
CLI.
dotnet test
Unity
The main SDK should be the "single source of truth". This means that all code should be written in the main project and then copied over to the Unity project.
To open the project in Unity, you need to open the Unity
folder as a project.
🤝 Contributing
Contributions, issues and feature requests are welcome!
Please make sure your pull requests are made to the develop
branch and that you have tested your changes. If you're adding a new feature, please also add tests for it.
Your code should follow the C# Coding Conventions. Your commits should follow the Conventional Commits standard.
📃 License
Product | Versions 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 is compatible. 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 is compatible. 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
-
.NETStandard 2.1
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.