Struct AllocatorManager.Range
A range of allocated memory.
Namespace: Unity.Collections
Syntax
public struct Range : IDisposable
Remarks
The name is perhaps misleading: only in combination with a AllocatorManager.Block does
a Range
have sufficient information to represent the number of bytes in an allocation. The reason Range
is its own type that's separate from Block
stems from some efficiency concerns in the implementation details. In most cases, a Range
is only used in conjunction with an associated Block
.
Fields
Allocator
The allocator function used for this range.
Declaration
public AllocatorManager.AllocatorHandle Allocator
Field Value
Type | Description |
---|---|
AllocatorManager.AllocatorHandle | The allocator function used for this range. |
Items
Number of items allocated in this range.
Declaration
public int Items
Field Value
Type | Description |
---|---|
Int32 | Number of items allocated in this range. |
Remarks
The actual allocation may be larger. See AllocatedItems.
Pointer
Pointer to the start of this range.
Declaration
public IntPtr Pointer
Field Value
Type | Description |
---|---|
IntPtr | Pointer to the start of this range. |
Methods
Dispose()
Deallocates the memory represented by this range.
Declaration
public void Dispose()
Remarks
Same as disposing the AllocatorManager.Block which contains this range.
Cannot be used with allocators which need the allocation size to deallocate.