Microsoft SDK for Java

addrOfPinnedObject

This method of the DllLib class returns the address of the object's data while an object is pinned.

Syntax

public static int addrOfPinnedObject(int nHandleIndex);

While an address is pinned, it will not be reclaimed by the garbage collector and will not move in memory. You must specifically free this handle by calling freePinnedHandle. For performance reasons, objects should not be pinned for long periods of time. Generally, you will pin an array during some native I/O operation, and then unpin it.

Note   Only single-dimension arrays of primitive types can be pinned.

Return Value

Returns the address of the object that is encapsulated by the given pinned handle.

Parameters

nHandleIndex A pinned handle that is obtained by calling getPinnedHandle.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.