Click or drag to resize

JCOBridgeDisposeFastScope Class

Opens a high-performance batch scope for deferred JVM global reference disposal, optimized for synchronous code running on a controlled thread. Disposal of JVM objects within this scope is batched and flushed in a single P/Invoke call when the scope exits, reducing crossing overhead.
Inheritance Hierarchy
SystemObject
  MASES.JCOBridge.C2JBridgeJCOBridgeDisposeFastScope

Namespace: MASES.JCOBridge.C2JBridge
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.6.9.260611-9a148513a79c26cdd7f1dde468f4f9e06ef3bc7e
Syntax
public sealed class JCOBridgeDisposeFastScope : IDisposable

The JCOBridgeDisposeFastScope type exposes the following members.

Constructors
 NameDescription
Public methodJCOBridgeDisposeFastScope Initializes a new high-performance batch dispose scope.
Top
Methods
 NameDescription
Public methodDispose Releases the high-performance batch scope, flushing any queued JVM global reference releases in a single native call. Suppresses finalization after disposal.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Finalizer
(Overrides ObjectFinalize)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Extension Methods
 NameDescription
Public Extension MethodConvertTReturn Converts a generic object
(Defined by JCOBridgeExtensions)
Public Extension MethodToNative Converts a generic input to an object manageable from the JVM
(Defined by JCOBridgeExtensions)
Top
Remarks
This scope is not safe for async/await — if a continuation resumes on a different thread the scope state will not be visible. For async contexts use JCOBridgeDisposeAsyncScope.
Example
C#
using var scope = new JCOBridgeDisposeFastScope();
foreach (var record in consumerRecords)
{
    using (record) { /* record disposal is batched */ }
}
See Also