Skip to content

Instantly share code, notes, and snippets.

View prozolic's full-sized avatar
💭
I may be slow to respond.

prozolic prozolic

💭
I may be slow to respond.
View GitHub Profile
@prozolic
prozolic / ExtendableArray.cs
Last active May 8, 2025 11:34
[ Targets .NET 8 and above ] A memory efficient array implementation that automatically extends its capacity while leveraging the ArrayPool.Shared to reduce allocations. Designed for high performance scenarios where memory management is critical.
using System.Buffers;
using System.Runtime.CompilerServices;
// namespace XXXXXX;
internal struct ExtendableArray<T>
{
private T[] array;
private int count;