Search Results for

    Show / Hide Table of Contents

    Method Assert

    Assert(MemSnapshot, Nullable<AssertionsThread>)

    Asserts that the memory usage since the comparisonSnapshot meets the memory usage defined by this AssertionsDefinition. This is equivalent to calling the MemAssertion.Assert method.

    Declaration
    public bool Assert(MemSnapshot comparisonSnapshot, AssertionsThread? assertionsThread = default(AssertionsThread? ))
    Parameters
    Type Name Description
    MemSnapshot comparisonSnapshot

    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.

    System.Nullable<AssertionsThread> 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.

    If the is not specified and this definition was created using MemAssertion.BeginAssertionsDefinition, the AssertionsThread from the BeginAssertionsDefinition call will be used.

    note

    This parameter does not affect allocation assertions (AssertionsDefinition.MaxAllocations and AssertionsDefinition.MaxAllocatedBytes). Allocations for all threads are always considered for allocation assertions.

    Returns
    Type Description
    System.Boolean

    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.

    Assert(Nullable<AssertionsThread>)

    Asserts that the memory usage since the comparisonSnapshot meets the memory usage defined by this AssertionsDefinition. This is equivalent to calling the MemAssertion.Assert method.

    Declaration
    public bool Assert(AssertionsThread? assertionsThread = default(AssertionsThread? ))
    Parameters
    Type Name Description
    System.Nullable<AssertionsThread> assertionsThread
    Returns
    Type Description
    System.Boolean

    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.

    In This Article
    Back to top

    © Copyright 2002-2020. SciTech Software AB.
    For information about .NET Memory Profiler, see the product site at https://memprofiler.com