Defines that instances of Types that matches the provided name (and optionally
their subclasses) are allowed to exist when this definition is asserted using
MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).
Namespace:
SciTech.NetMemProfilerAssembly: MemProfiler2 (in MemProfiler2.dll)
Syntax
| C# |
|---|
public void AllowInstances( string typeName, bool includeSubclasses ) |
| Visual Basic |
|---|
Public Sub AllowInstances ( _ typeName As String, _ includeSubclasses As Boolean _ ) |
| Visual C++ |
|---|
public: void AllowInstances( String^ typeName, bool includeSubclasses ) |
Parameters
- typeName
- Type: System..::..String
The type name of the instances that should be allowed.
- includeSubclasses
- Type: System..::..Boolean
Indicates whether instances of subclasses of the specified types should be checked.
Remarks
Including a type in a call to AllowInstances, will override instance restrictions defined
using a call to NoInstances(array<Type>[]()[][], Boolean) or NoNewInstances(array<Type>[]()[][], Boolean).
Note
The AllowXXX (AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and
MaxXXX (MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32),
MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes
precedence over the NoXXX (NoInstances(TypeSet), NoNewInstances(TypeSet)) methods.
For more information see AssertionsDefinition.
Note
The name of a Type can end with the wildcard character '*',
which allows all types that starts with the specified text
to be matched. This can be used to include all types in a namespace
(e.g. “System.Windows.Forms.*” will include all types in
the System.Windows.Forms namespace).