Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeLocalAllocHandle.cs
Go to the documentation of this file.
2
4
5internal sealed class SafeLocalAllocHandle : SafeBuffer
6{
8 : base(ownsHandle: true)
9 {
10 }
11
12 internal static SafeLocalAllocHandle LocalAlloc(int cb)
13 {
14 SafeLocalAllocHandle safeLocalAllocHandle = new SafeLocalAllocHandle();
15 safeLocalAllocHandle.SetHandle(Marshal.AllocHGlobal(cb));
16 safeLocalAllocHandle.Initialize((ulong)cb);
17 return safeLocalAllocHandle;
18 }
19
20 protected override bool ReleaseHandle()
21 {
23 return true;
24 }
25}
static SafeLocalAllocHandle LocalAlloc(int cb)
static void FreeHGlobal(IntPtr hglobal)
Definition Marshal.cs:1680
static IntPtr AllocHGlobal(int cb)
Definition Marshal.cs:625