Struct MemoryHeader<T>
A memory header maintains a chunk of memory that contains an arbitrary collection of nested value types. This is a workaround for the inability to nest NativeArrays.
Namespace: Unity.Kinematica
Syntax
public struct MemoryHeader<T> : IDisposable where T : struct
Type Parameters
Name | Description |
---|---|
T |
Properties
IsValid
Determines if the given memory header is valid or not.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean | True if the memory header is valid; false otherwise. |
Ref
Retrieves the original ref value from the memory header.
Declaration
public T Ref { get; }
Property Value
Type | Description |
---|---|
T |
Methods
Create(ref T)
Constructs a new memory reference from a ref value.
Declaration
public static MemoryRef<T> Create(ref T target)
Parameters
Type | Name | Description |
---|---|---|
T | target | The ref value that this memory reference should be constructed for. |
Returns
Type | Description |
---|---|
MemoryRef<T> |
CreateInvalid()
Create invalid memory header that don't point to any data
Declaration
public static MemoryHeader<T> CreateInvalid()
Returns
Type | Description |
---|---|
MemoryHeader<T> |
Dispose()
Disposes the underlying allocated memory of the memory header.
Declaration
public void Dispose()