Asserts that the memory usage since the comparisonSnapshot meets the memory usage
defined by the supplied AssertionsDefinition.
Namespace:
SciTech.NetMemProfilerAssembly: MemProfiler2 (in MemProfiler2.dll)
Syntax
| C# |
|---|
public static bool Assert( MemSnapShot comparisonSnapshot, AssertionsDefinition assertionsDefinition, AssertionsThread assertionsThread ) |
| Visual Basic |
|---|
Public Shared Function Assert ( _ comparisonSnapshot As MemSnapShot, _ assertionsDefinition As AssertionsDefinition, _ assertionsThread As AssertionsThread _ ) As Boolean |
| Visual C++ |
|---|
public: static bool Assert( MemSnapShot comparisonSnapshot, AssertionsDefinition^ assertionsDefinition, AssertionsThread assertionsThread ) |
Parameters
- comparisonSnapshot
- Type: SciTech.NetMemProfiler..::..MemSnapShot
Identifies the snapshot to use as the comparison snapshot. Instances that did not exist at the time of the comparison snapshot, are considered to be new instances.
- assertionsDefinition
- Type: SciTech.NetMemProfiler..::..AssertionsDefinition
Defines the expected memory usage. For more information, see AssertionsDefinition.
- assertionsThread
- Type: SciTech.NetMemProfiler..::..AssertionsThread
Indicates whether instances of all threads should be checked, or only instances created by the calling thread. If this parameter is AssertionsThread.All, then instances of all threads will be checked. If it is AssertionsThread.Caller, then only instances created by the calling thread will be checked.
Return Value
If the current process is being profiled, true will be returned if the assertion succeeds, otherwise false will be returned.If the current process is not being profiled, no assertion is performed and true will always be returned.