41 protected override void Dispose(
bool disposing)
60 stream.CopyTo(nativeHeapMemoryBlock.
Pointer + num, size - num);
68 nativeHeapMemoryBlock.
Dispose();
71 return nativeHeapMemoryBlock;
106 if (disposable ==
null)
117 if (disposable2 ==
null)
static unsafe int ReadFile(Stream stream, byte *buffer, int size)
static IDisposable CreateMemoryMap(Stream stream)
static bool TryGetSafeBufferAndPointerOffset(object accessor, out SafeBuffer safeBuffer, out long offset)
static IDisposable CreateViewAccessor(object memoryMap, long start, int size)
unsafe override byte * Pointer
StreamMemoryBlockProvider(Stream stream, long imageStart, int imageSize, bool isFileStream, bool leaveOpen)
static unsafe NativeHeapMemoryBlock ReadMemoryBlockNoLock(Stream stream, bool isFileStream, long start, int size)
override AbstractMemoryBlock GetMemoryBlockImpl(int start, int size)
readonly object _streamGuard
readonly long _imageStart
const int MemoryMapThreshold
bool TryCreateMemoryMappedFileBlock(long start, int size, [NotNullWhen(true)] out MemoryMappedFileBlock block)
readonly bool _isFileStream
override void Dispose(bool disposing)
override Stream GetStream(out StreamConstraints constraints)
IDisposable _lazyMemoryMap
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)