Skip to content

Instantly share code, notes, and snippets.

@samloeschen
samloeschen / Arena.cs
Last active July 27, 2023 14:12
C# unmanaged arena allocator and collections for it
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using Range = System.Range;
public unsafe struct Arena {
UnmanagedArray<Optional<Block>> _blocks;
int _currentBlockIndex;