Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeLocalAllocHandle.cs
Go to the documentation of this file.
1using System;
3
5
6internal sealed class SafeLocalAllocHandle : SafeBuffer
7{
9
11 : base(ownsHandle: true)
12 {
13 }
14
15 internal static SafeLocalAllocHandle LocalAlloc(int cb)
16 {
17 SafeLocalAllocHandle safeLocalAllocHandle = new SafeLocalAllocHandle();
18 safeLocalAllocHandle.SetHandle(Marshal.AllocHGlobal(cb));
19 safeLocalAllocHandle.Initialize((ulong)cb);
20 return safeLocalAllocHandle;
21 }
22
24 : base(ownsHandle: true)
25 {
27 }
28
29 protected override bool ReleaseHandle()
30 {
32 return true;
33 }
34}
static SafeLocalAllocHandle LocalAlloc(int cb)
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static IntPtr AllocHGlobal(int cb)
Definition Marshal.cs:625
static readonly IntPtr Zero
Definition IntPtr.cs:18