Constructor CustomMaterializationUnit
CustomMaterializationUnit(LazyEncodedString, MaterializationAction, IReadOnlyCollection<KeyValuePair<SymbolStringPoolEntry, SymbolFlags>>, SymbolStringPoolEntry?)
Initializes a new instance of the CustomMaterializationUnit class.
public CustomMaterializationUnit(LazyEncodedString name, MaterializationAction materializeAction, IReadOnlyCollection<KeyValuePair<SymbolStringPoolEntry, SymbolFlags>> symbols, SymbolStringPoolEntry? initSymbol = null)
Parameters
name
LazyEncodedStringName of this instance
materializeAction
MaterializationActionAction to perform to materialize the symbol
symbols
IReadOnlyCollection<KeyValuePair<SymbolStringPoolEntry, SymbolFlags>>symbols the materializer works on
initSymbol
SymbolStringPoolEntrySymbol of static initializer (if any)
CustomMaterializationUnit(LazyEncodedString, MaterializationAction, DiscardAction?, IReadOnlyCollection<KeyValuePair<SymbolStringPoolEntry, SymbolFlags>>, SymbolStringPoolEntry?)
Initializes a new instance of the CustomMaterializationUnit class.
public CustomMaterializationUnit(LazyEncodedString name, MaterializationAction materializeAction, DiscardAction? discardAction, IReadOnlyCollection<KeyValuePair<SymbolStringPoolEntry, SymbolFlags>> symbols, SymbolStringPoolEntry? initSymbol = null)
Parameters
name
LazyEncodedStringName of this instance
materializeAction
MaterializationActionAction to perform to materialize the symbol
discardAction
DiscardActionAction to perform when the JIT discards/replaces a symbol
symbols
IReadOnlyCollection<KeyValuePair<SymbolStringPoolEntry, SymbolFlags>>symbols the materializer works on
initSymbol
SymbolStringPoolEntrySymbol of static initializer (if any)
Remarks
This implementation will maintain the lifetime of the provided delegates via an internally allocated disposable
until the materialization is completed or abandoned. If materializeAction
is not called, then
the discardAction
is. This allows for cases where the data used by the materializeAction
is not held by the action itself or needs to support early disposal instead of remaining at the whims of the GC.