Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExternalMemoryBlockProvider.cs
Go to the documentation of this file.
1
using
System.IO
;
2
3
namespace
System.Reflection.Internal
;
4
5
internal
sealed
class
ExternalMemoryBlockProvider
:
MemoryBlockProvider
6
{
7
private
unsafe
byte
*
_memory
;
8
9
private
int
_size
;
10
11
public
override
int
Size
=>
_size
;
12
13
public
unsafe
byte
*
Pointer
=>
_memory
;
14
15
public
unsafe
ExternalMemoryBlockProvider
(
byte
* memory,
int
size)
16
{
17
_memory
= memory;
18
_size
= size;
19
}
20
21
protected
unsafe
override
AbstractMemoryBlock
GetMemoryBlockImpl
(
int
start
,
int
size)
22
{
23
return
new
ExternalMemoryBlock
(
this
,
_memory
+
start
, size);
24
}
25
26
public
unsafe
override
Stream
GetStream
(out
StreamConstraints
constraints)
27
{
28
constraints =
new
StreamConstraints
(
null
, 0
L
,
_size
);
29
return
new
ReadOnlyUnmanagedMemoryStream
(
_memory
,
_size
);
30
}
31
32
protected
unsafe
override
void
Dispose
(
bool
disposing)
33
{
34
_memory
=
null
;
35
_size
= 0;
36
}
37
}
System.IO.Stream
Definition
Stream.cs:11
System.Reflection.Internal.AbstractMemoryBlock
Definition
AbstractMemoryBlock.cs:7
System.Reflection.Internal.ExternalMemoryBlockProvider.Size
override int Size
Definition
ExternalMemoryBlockProvider.cs:11
System.Reflection.Internal.ExternalMemoryBlockProvider.ExternalMemoryBlockProvider
unsafe ExternalMemoryBlockProvider(byte *memory, int size)
Definition
ExternalMemoryBlockProvider.cs:15
System.Reflection.Internal.ExternalMemoryBlockProvider._size
int _size
Definition
ExternalMemoryBlockProvider.cs:9
System.Reflection.Internal.ExternalMemoryBlockProvider.GetStream
unsafe override Stream GetStream(out StreamConstraints constraints)
Definition
ExternalMemoryBlockProvider.cs:26
System.Reflection.Internal.ExternalMemoryBlockProvider._memory
unsafe byte * _memory
Definition
ExternalMemoryBlockProvider.cs:7
System.Reflection.Internal.ExternalMemoryBlockProvider.GetMemoryBlockImpl
unsafe override AbstractMemoryBlock GetMemoryBlockImpl(int start, int size)
Definition
ExternalMemoryBlockProvider.cs:21
System.Reflection.Internal.ExternalMemoryBlockProvider.Dispose
unsafe override void Dispose(bool disposing)
Definition
ExternalMemoryBlockProvider.cs:32
System.Reflection.Internal.ExternalMemoryBlockProvider
Definition
ExternalMemoryBlockProvider.cs:6
System.Reflection.Internal.ExternalMemoryBlock
Definition
ExternalMemoryBlock.cs:4
System.Reflection.Internal.MemoryBlockProvider
Definition
MemoryBlockProvider.cs:6
System.Reflection.Internal.ReadOnlyUnmanagedMemoryStream
Definition
ReadOnlyUnmanagedMemoryStream.cs:7
System.Reflection.Pointer
Definition
Pointer.cs:8
System.IO
Definition
ConsoleStream.cs:3
System.Reflection.Internal
Definition
AbstractMemoryBlock.cs:4
System.ExceptionArgument.start
@ start
System.ConsoleKey.L
@ L
System.Reflection.Internal.StreamConstraints
Definition
StreamConstraints.cs:4
source
System.Reflection.Metadata
System.Reflection.Internal
ExternalMemoryBlockProvider.cs
Generated by
1.10.0