Upraviť

Zdieľať cez


GC.RegisterNoGCRegionCallback(Int64, Action) Method

Definition

Registers a callback to be invoked when a certain amount of memory is allocated in the no GC region.

public:
 static void RegisterNoGCRegionCallback(long totalSize, Action ^ callback);
public static void RegisterNoGCRegionCallback (long totalSize, Action callback);
static member RegisterNoGCRegionCallback : int64 * Action -> unit
Public Shared Sub RegisterNoGCRegionCallback (totalSize As Long, callback As Action)

Parameters

totalSize
Int64

The total size of the no GC region.

callback
Action

The callback to be executed when a certain amount of memory is allocated in the no GC region.

Exceptions

totalSize is less than or equal to 0.

The callback argument is null.

The GC is not currently under a NoGC region.

-or-

Another callback is already registered.

-or-

The totalSize exceeds the size of the No GC region.

-or-

The operation to withhold memory for the callback failed.

Applies to