Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MemoryHandle.cs
Go to the documentation of this file.
1
using
System.Runtime.InteropServices
;
2
3
namespace
System.Buffers
;
4
5
public
struct
MemoryHandle
:
IDisposable
6
{
7
private
unsafe
void
*
_pointer
;
8
9
private
GCHandle
_handle
;
10
11
private
IPinnable
_pinnable
;
12
13
[CLSCompliant(
false
)]
14
public
unsafe
void
*
Pointer
=>
_pointer
;
15
16
[CLSCompliant(
false
)]
17
public
unsafe
MemoryHandle
(
void
*
pointer
,
GCHandle
handle
=
default
(
GCHandle
),
IPinnable
? pinnable =
null
)
18
{
19
_pointer
=
pointer
;
20
_handle
=
handle
;
21
_pinnable
= pinnable;
22
}
23
24
public
unsafe
void
Dispose
()
25
{
26
if
(
_handle
.
IsAllocated
)
27
{
28
_handle
.
Free
();
29
}
30
if
(
_pinnable
!=
null
)
31
{
32
_pinnable
.
Unpin
();
33
_pinnable
=
null
;
34
}
35
_pointer
=
null
;
36
}
37
}
System.Buffers.IPinnable.Unpin
void Unpin()
System.Buffers.IPinnable
Definition
IPinnable.cs:4
System.IDisposable
Definition
IDisposable.cs:4
System.Buffers
Definition
Base64.cs:7
System.Runtime.InteropServices
Definition
SequenceMarshal.cs:4
System.ExceptionArgument.pointer
@ pointer
System.ExceptionArgument.handle
@ handle
System.Buffers.MemoryHandle._pointer
unsafe void * _pointer
Definition
MemoryHandle.cs:7
System.Buffers.MemoryHandle.MemoryHandle
unsafe MemoryHandle(void *pointer, GCHandle handle=default(GCHandle), IPinnable? pinnable=null)
Definition
MemoryHandle.cs:17
System.Buffers.MemoryHandle.Dispose
unsafe void Dispose()
Definition
MemoryHandle.cs:24
System.Buffers.MemoryHandle._handle
GCHandle _handle
Definition
MemoryHandle.cs:9
System.Buffers.MemoryHandle._pinnable
IPinnable _pinnable
Definition
MemoryHandle.cs:11
System.Buffers.MemoryHandle.Pointer
unsafe void * Pointer
Definition
MemoryHandle.cs:14
System.Buffers.MemoryHandle
Definition
MemoryHandle.cs:6
System.Runtime.InteropServices.GCHandle.IsAllocated
bool IsAllocated
Definition
GCHandle.cs:32
System.Runtime.InteropServices.GCHandle.Free
void Free()
Definition
GCHandle.cs:91
System.Runtime.InteropServices.GCHandle
Definition
GCHandle.cs:9
source
System.Private.CoreLib
System.Buffers
MemoryHandle.cs
Generated by
1.10.0