Struct DoubleRewindableAllocators
A double rewindable allocators RewindableAllocator.
Namespace: Unity.Collections
Assembly: Unity.Collections.dll
Syntax
public struct DoubleRewindableAllocators
Constructors
DoubleRewindableAllocators(AllocatorHandle, int)
Construct a double rewindable allocators by allocating the allocators from backingAllocator and registering them.
Declaration
public DoubleRewindableAllocators(AllocatorManager.AllocatorHandle backingAllocator, int initialSizeInBytes)
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.AllocatorHandle | backingAllocator | Allocator used to allocate the double rewindable allocators. |
int | initialSizeInBytes | The initial capacity of the allocators, in bytes |
Properties
Allocator
Retrieve the current rewindable allocator.
Declaration
public ref RewindableAllocator Allocator { get; }
Property Value
Type | Description |
---|---|
RewindableAllocator | The Allocator retrieved. |
IsCreated
Check whether the double rewindable allocators is created.
Declaration
public bool IsCreated { get; }
Property Value
Type | Description |
---|---|
bool | True if current allocator is not null, otherwise false. |
Methods
Dispose()
the double rewindable allocators and unregister it.
Declaration
public void Dispose()
Initialize(AllocatorHandle, int)
Initialize a double rewindable allocators by allocating the allocators from backingAllocator and registering them.
Declaration
public void Initialize(AllocatorManager.AllocatorHandle backingAllocator, int initialSizeInBytes)
Parameters
Type | Name | Description |
---|---|---|
AllocatorManager.AllocatorHandle | backingAllocator | Allocator used to allocate the double rewindable allocators. |
int | initialSizeInBytes | The initial capacity of the allocators, in bytes |
Update()
Update the double rewindable allocators, switch Pointer to another allocator and rewind the newly switched allocator.
Declaration
public void Update()