提交 1a2fdf48 编写于 作者: P Pharring

Review feedback from TemporaryStorageServiceFactory.MemoryMappedFile changes (changeset 1384016)

上级 bd7ca1ca
......@@ -251,9 +251,8 @@ public SharedReadableStream(MemoryMappedInfo owner, MemoryMappedViewAccessor acc
this.owner = owner;
this.accessor = accessor;
this.start = AcquirePointer();
this.current = this.start;
this.end = this.start + length;
this.current = this.start = AcquirePointer(accessor);
this.end = checked(this.start + length);
}
~SharedReadableStream()
......@@ -422,11 +421,11 @@ public IntPtr GetPointer()
/// The pointer will be released during <see cref="Dispose(bool)"/>
/// </summary>
/// <returns>The pointer to the start of the memory mapped view. The pointer is valid, and remains fixed for the lifetime of this object.</returns>
private byte* AcquirePointer()
private static byte* AcquirePointer(MemoryMappedViewAccessor accessor)
{
byte* ptr = null;
this.accessor.SafeMemoryMappedViewHandle.AcquirePointer(ref ptr);
ptr += GetPrivateOffset(this.accessor);
accessor.SafeMemoryMappedViewHandle.AcquirePointer(ref ptr);
ptr += GetPrivateOffset(accessor);
return ptr;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册