提交 a0fdc69a 编写于 作者: S Sam Harwell

Expand comment in CreateRecoverableText

上级 2def19cb
......@@ -100,7 +100,12 @@ protected static ValueSource<TextAndVersion> CreateRecoverableText(TextAndVersio
{
var result = new RecoverableTextAndVersion(CreateStrongText(text), services.TemporaryStorage);
// Ensure the recoverable text is saved in temporary storage
// This RecoverableTextAndVersion is created directly from a TextAndVersion instance. In its initial state,
// the RecoverableTextAndVersion keeps a strong reference to the initial TextAndVersion, and only
// transitions to a weak reference backed by temporary storage after the first time GetValue (or
// GetValueAsync) is called. Since we know we are creating a RecoverableTextAndVersion for the purpose of
// avoiding problematic address space overhead, we call GetValue immediately to force the object to weakly
// hold its data from the start.
result.GetValue();
return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册