Class LRUCacheAllocationStrategy
Allocation strategy that uses internal pools of objects to avoid allocations that can trigger GC calls.
Inheritance
System.Object
LRUCacheAllocationStrategy
Namespace: UnityEngine.ResourceManagement.Util
Syntax
public class LRUCacheAllocationStrategy : IAllocationStrategy
Constructors
LRUCacheAllocationStrategy(Int32, Int32, Int32, Int32)
Create a new LRUAllocationStrategy objct.
Declaration
public LRUCacheAllocationStrategy(int poolMaxSize, int poolCapacity, int poolCacheMaxSize, int initialPoolCacheCapacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | poolMaxSize | The max size of each pool. |
System.Int32 | poolCapacity | The initial capacity to create each pool list with. |
System.Int32 | poolCacheMaxSize | The max size of the internal pool cache. |
System.Int32 | initialPoolCacheCapacity | The initial number of pools to create. |
Methods
New(Type, Int32)
Create a new object of type t.
Declaration
public object New(Type type, int typeHash)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to return. |
System.Int32 | typeHash | The hash code of the type. |
Returns
Type | Description |
---|---|
System.Object | The new object. |
Implements
Release(Int32, Object)
Release an object.
Declaration
public void Release(int typeHash, object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | typeHash | |
System.Object | obj | The object to release. |