Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created May 26, 2017 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannagel/d097f7cca6d454a4fb78e7d642a715ee to your computer and use it in GitHub Desktop.
Save christiannagel/d097f7cca6d454a4fb78e7d642a715ee to your computer and use it in GitHub Desktop.
Use a shared ArrayPool
private static void LocalUseOfSharedPool(int i)
{
int[] arr = ArrayPool<int>.Shared.Rent(ARRAYSIZE);
ShowAddress($"simple array {i}", arr);
FillTheArray(arr);
UseTheArray(arr);
ArrayPool<int>.Shared.Return(arr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment