Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AlignedRealloc()

static unsafe void * System.Runtime.InteropServices.NativeMemory.AlignedRealloc ( void * ptr,
nuint byteCount,
nuint alignment )
inlinestatic

Definition at line 57 of file NativeMemory.cs.

58 {
59 if (!BitOperations.IsPow2(alignment))
60 {
61 ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_AlignmentMustBePow2);
62 }
63 void* ptr2 = Interop.Ucrtbase._aligned_realloc(ptr, (byteCount != 0) ? byteCount : 1, alignment);
64 if (ptr2 == null)
65 {
66 ThrowHelper.ThrowOutOfMemoryException();
67 }
68 return ptr2;
69 }
static unsafe void * _aligned_realloc(void *ptr, nuint size, nuint alignment)
static bool IsPow2(int value)

References Interop.Ucrtbase._aligned_realloc(), System.byteCount, System.Numerics.BitOperations.IsPow2(), System.ThrowHelper.ThrowArgumentException(), and System.ThrowHelper.ThrowOutOfMemoryException().