Pinned ハンドル内のオブジェクトのアドレスを取得します。
Public Function AddrOfPinnedObject() As IntPtr
[C#]
public IntPtr AddrOfPinnedObject();
[C++]
public: IntPtr AddrOfPinnedObject();
[JScript]
public function AddrOfPinnedObject() : IntPtr;
戻り値
IntPtr としての Pinned オブジェクトのアドレス。
例外
例外の種類 | 条件 |
---|---|
InvalidOperationException | このハンドルは、 Pinned 以外の任意の型になります。 |
解説
このメソッドは、オブジェクトへの固定ポインタを取得するために使用します。オブジェクトを固定することによってガベージ コレクタがそのオブジェクトをメモリ内で移動できなくなるため、ガベージ コレクタの効率は低下します。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard
.NET Framework セキュリティ:
- SecurityPermission (アンマネージ コードを操作するために必要なアクセス許可) SecurityPermissionFlag.UnmanagedCode (関連する列挙体)
参照
GCHandle 構造体 | GCHandle メンバ | System.Runtime.InteropServices 名前空間 | GCHandleType