Class UnsafeGenericPool<T>
Generic pool without collection checks. This class is an alternative for the GenericPool for object that allocate memory when they are being compared. It is the case for the CullingResult class from Unity, and because of this in HDRP HDCullingResults generates garbage whenever we use ==, .Equals or ReferenceEquals. This pool doesn't do any of these comparison because we don't check if the stack already contains the element before releasing it.
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public static class UnsafeGenericPool<T> where T : new()
Type Parameters
Name | Description |
---|---|
T | Type of the objects in the pull. |
Methods
Name | Description |
---|---|
Get() | Get a new object. |
Get(out T) | Get a new PooledObject |
Release(T) | Release an object to the pool. |