Show / Hide Table of Contents

Class MemoryUtil

Allocates memory from native heap of this process using heap API. Also has more functions to work with memory: copy, move, virtual alloc.

public static class MemoryUtil
Remarks

Uses the common heap of this process, API GetProcessHeap.


Namespace: Au.More
Assembly: Au.dll
Inheritance
object
MemoryUtil

Methods

Name Description
Alloc(nint, bool)

Allocates new memory block and returns its address.

Alloc<T>(nint, bool)

Allocates new memory block and returns its address.

Copy(void*, void*, nint)

Copies memory with System.Buffer.MemoryCopy.

Free(void*)

Frees a memory block. Does nothing if mem is null.

FreeAlloc<T>(ref T*, nint, bool)

Frees a memory block (if not null) and allocates new.

Move(void*, void*, nint)

Copies memory with API memmove.

ReAlloc<T>(ref T*, nint, bool)

Reallocates a memory block to make it bigger or smaller.

VirtualAlloc(nint)

Allocates new virtual memory block with API VirtualAlloc and returns its address: VirtualAlloc(default, size, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE).

VirtualFree(void*)

Frees a memory block allocated with MemoryUtil.VirtualAlloc. Does nothing if mem is null.