Table of Contents

Interface IResizableAllocator

Namespace
SharpPluginLoader.Core.Memory
Assembly
SharpPluginLoader.Core.dll

Describes an allocator that can also reallocate memory blocks.

public interface IResizableAllocator : IAllocator
Inherited Members

Methods

Reallocate(void*, nint)

Reallocates a previously allocated memory block to the specified size.

void* Reallocate(void* ptr, nint size)

Parameters

ptr void*

The pointer to the memory block to reallocate.

size nint

The new size of the memory block.

Returns

void*

A pointer to the reallocated memory block.

Reallocate<TObj>(TObj*, int)

Reallocates a previously allocated object array to the specified number of instances.

TObj* Reallocate<TObj>(TObj* ptr, int count) where TObj : unmanaged

Parameters

ptr TObj*

The pointer to the memory block to reallocate.

count int

The new number of instances to allocate.

Returns

TObj*

A pointer to the reallocated memory block.

Type Parameters

TObj

The type of object to reallocate.