Version: Unity 6 Preview (6000.0)
LanguageEnglish
  • C#

UnsafeUtility.PinGCObjectAndGetAddress

Declaration

public static void* PinGCObjectAndGetAddress(object target, out ulong gcHandle);

Description

Keeps a strong GC reference to an object and pins it.

The object is guaranteed to not move its memory location in a moving GC. Returns the address of the memory location of the object.

Additional resources: UnsafeUtility.ReleaseGCObject.