Method Alloc
Alloc(int)
Allocates size bytes of uninitialized storage.
IntPtr Alloc(int size)
Parameters
size
intNumber of bytes to allocate.
Returns
- nint
On success, returns the pointer to the beginning of newly allocated memory. To avoid a memory leak, the returned pointer must be deallocated with FreeMem(IntPtr) or Realloc(IntPtr, int). On failure, returns a null pointer.
Remarks
If allocation succeeds, returns a pointer to the lowest (first) byte in the allocated memory block that is suitably aligned for any scalar type (implicitly creating objects in the destination area).