Summary
- Namespace
- Avalonia
.Collections .Pooled - Interfaces
-
- IComparable
- IFormattable
- IConvertible
- Base Types
-
- object
- ValueType
- Enum
Syntax
public enum ClearMode
Fields
Name | Constant Value | Summary |
---|---|---|
Always | 1 |
The
setting has the effect of always clearing user types before returning to the pool.
This is the default behavior on .NET Standard.You might want to turn this on in a .NET Core project if you were concerned about sensitive data stored in value types leaking to other pars of your application. static
|
Auto | 0 |
has different behavior depending on the host project's target framework.
.NET Core 2.1: Reference types and value types that contain reference types are cleared when the internal arrays are returned to the pool. Value types that do not contain reference types are not cleared when returned to the pool. .NET Standard 2.0: All user types are cleared before returning to the pool, in case they contain reference types. For .NET Standard, Auto and Always have the same behavior. static
|
Never | 2 |
will cause pooled collections to never clear user types before returning them to the pool.
You might want to use this setting in a .NET Standard project when you know that a particular collection stores only value types and you want the performance benefit of not taking time to reset array items to their default value. Be careful with this setting: if used for a collection that contains reference types, or value types that contain reference types, this setting could cause memory issues by making the garbage collector unable to clean up instances that are still being referenced by arrays sitting in the ArrayPool. static
|
Extension Methods
Name | Value | Summary |
---|---|---|
HasAllFlags |
bool |
From EnumExtensions
|
HasAnyFlag |
bool |
From EnumExtensions
|
HasFlagCustom |
bool |
From EnumExtensions
|