initialPrefabs logo
  • Home 
  • Blog 
  • Games 
  • Tools 
  • Tags 
  1. Home
  2. Tools
  3. No Alloc Collections Documentation

No Alloc Collections Documentation

No Alloc Collections is a library that provides stack only data structures in C#. This means that you cannot store these collections as member variables in structs or classes and can only live in the closure they are declared.

You can store them in ref struct as they are within the closure of the stack.

All data structures must be backed by your custom allocated memory. This can be done through the stackalloc keyword or aliased as a span from a managed Array.

Installation  

  • For use within Unity please use OpenUpm.
  • For use with regular dotnet projects
    • You can embed the source directly into your project
    • Grab it on nuget
dotnet add package NoAllocCollections

Table of Contents  

  • MathUtils
  • NoAllocBitArray
  • NoAllocBitArrayEnumerator
  • NoAllocBitArrayExtensions
  • NoAllocEnumerator
  • NoAllocHashMap
  • NoAllocHashSet
  • NoAllocList
  • NoAllocListExtensions
  • NoAllocPriorityQueue
  • NoAllocQueue
  • NoAllocQueueExtensions

1 min read • Tools

NoAllocQueue

NoAllocQueue namespace InitialPrefabs.Collections Summary A stack only queue that uses a Span{T} as it’s internal data structure. Go back to API Home

2 min read • Tools

NoAllocQueueExtensions

NoAllocQueueExtensions namespace InitialPrefabs.Collections bool TryPeek(this ref NoAllocQueue queue, out T item) Summary Attempts to look at the head of the queue if there are any items available. The queue to look at.The element at the head of the queue. ...

  • 1
  • 2
Follow Us!

Contact us if you want to work with us for your games and art projects!

     
Copyright © 2016-2026 InitialPrefabs
initialPrefabs
Code copied to clipboard