NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Root.Alloc

Allocates a handle to the specified, managed object, to prevent it being reclaimed by garbage collection.

[Visual Basic]
Public Shared Function Alloc( _
   ByVal value As Object _
) As Integer
[C#]
public static int Alloc(
   object value
);
[C++]
public: static int Alloc(
   Object* value
);
[JScript]
public static function Alloc(
   value : Object
) : int;

Parameters

value
The managed object to be 'rooted' against garbage collection

Return Value

A handle to the 'rooted' managed object. Only of use to the caller when it comes time to 'unroot' that managed object with a call to Free or to enquire the root handle with a call to Get.

Remarks

Root handles require explicit deallocation using the Free method. The object will not be reclaimed by the garbage collector until the Free method is called.

See Also

Root Class | Root Members | System.Runtime.InteropServices Namespace