Class LeapInternal::StructMarshal¶
- class LeapInternal.StructMarshal<T>¶
A helper class to marshal between unmanaged memory and structs without creating garbage.
Properties
- static int Size { get; set; }¶
Returns the size in bytes of the struct of type T. This call is equivalent to Marshal.Sizeof(typeof(T)) but caches the result for ease of access.
Public Static Functions
- static void PtrToStruct (IntPtr ptr, out T t)¶
Converts an IntPtr to a struct of type T.
- static void ArrayElementToStruct (IntPtr ptr, int arrayIndex, out T t)¶
Converts a single element in an array pointed to by ptr to a struct of type T. This method does not and cannot do any bounds checking! This method does not create any garbage.