Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ImmutableByteArrayInterop.cs
Go to the documentation of this file.
1
using
System.Collections.Immutable
;
2
using
System.Runtime.InteropServices
;
3
4
namespace
System.Reflection.Internal
;
5
6
internal
static
class
ImmutableByteArrayInterop
7
{
8
[StructLayout(
LayoutKind
.Explicit)]
9
private
struct
ByteArrayUnion
10
{
11
[FieldOffset(0)]
12
internal
byte
[]
UnderlyingArray
;
13
14
[FieldOffset(0)]
15
internal
ImmutableArray<byte>
ImmutableArray
;
16
}
17
18
internal
static
ImmutableArray<byte>
DangerousCreateFromUnderlyingArray
(ref
byte
[]?
array
)
19
{
20
byte
[] underlyingArray =
array
;
21
array
=
null
;
22
ByteArrayUnion
byteArrayUnion =
default
(
ByteArrayUnion
);
23
byteArrayUnion.UnderlyingArray = underlyingArray;
24
return
byteArrayUnion.
ImmutableArray
;
25
}
26
27
internal
static
byte
[]?
DangerousGetUnderlyingArray
(
ImmutableArray<byte>
array
)
28
{
29
ByteArrayUnion
byteArrayUnion =
default
(
ByteArrayUnion
);
30
byteArrayUnion.ImmutableArray =
array
;
31
return
byteArrayUnion.
UnderlyingArray
;
32
}
33
}
System.Collections.Immutable.ImmutableArray
Definition
ImmutableArray.cs:223
System.Reflection.Internal.ImmutableByteArrayInterop.DangerousGetUnderlyingArray
static ? byte[] DangerousGetUnderlyingArray(ImmutableArray< byte > array)
Definition
ImmutableByteArrayInterop.cs:27
System.Reflection.Internal.ImmutableByteArrayInterop.DangerousCreateFromUnderlyingArray
static ImmutableArray< byte > DangerousCreateFromUnderlyingArray(ref byte[]? array)
Definition
ImmutableByteArrayInterop.cs:18
System.Reflection.Internal.ImmutableByteArrayInterop
Definition
ImmutableByteArrayInterop.cs:7
System.Collections.Immutable
Definition
AllocFreeConcurrentStack.cs:4
System.Reflection.Internal
Definition
AbstractMemoryBlock.cs:4
System.Runtime.InteropServices.LayoutKind
LayoutKind
Definition
LayoutKind.cs:4
System.Runtime.InteropServices
Definition
SequenceMarshal.cs:4
System.ExceptionArgument.array
@ array
System.Reflection.Internal.ImmutableByteArrayInterop.ByteArrayUnion.UnderlyingArray
byte[] UnderlyingArray
Definition
ImmutableByteArrayInterop.cs:12
System.Reflection.Internal.ImmutableByteArrayInterop.ByteArrayUnion.ImmutableArray
ImmutableArray< byte > ImmutableArray
Definition
ImmutableByteArrayInterop.cs:15
System.Reflection.Internal.ImmutableByteArrayInterop.ByteArrayUnion
Definition
ImmutableByteArrayInterop.cs:10
source
System.Reflection.Metadata
System.Reflection.Internal
ImmutableByteArrayInterop.cs
Generated by
1.10.0