Heap

This struct encapsulates heap manipulation functionality.

This struct is neither default constructable nor copyable. Pass it by ref to functions or use $(STDREF typecons, RefCounted).

Constructors

this
this()
Undocumented in source.
this
this(CreateOptions options, size_t initialSize, size_t maximumSize)

Construct a new Heap.

this
this(HANDLE heapHandle, bool own)

Construct a Heap from a heapHandle.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Enums

CreateOptions
enum CreateOptions

Heap construction options.

Flags
enum Flags

General heap usage flags.

Functions

alloc
void* alloc(size_t bytes, bool zeroMemory, Flags flags)

Allocates a block of memory.

free
void free(void* p, Flags flags)

Frees a block of memory.

reAlloc
void* reAlloc(void* ptr, size_t bytes, bool zeroMemory, bool inPlaceOnly, Flags flags)

Reallocates a block of memory (i.e. memory content is preserved).

size
size_t size(void* p, Flags flags)

Retrieves the size of an allocated from this heap memory block.

Properties

associated
bool associated [@property getter]

Returns whether this is associated with a heap handle. It is asserted that no member functions are called for an unassociated Heap struct.

handle
HANDLE handle [@property getter]

Gets the handle of the associated heap.

ownHandle
bool ownHandle [@property getter]

Returns whether handle of the associated heap will be destroyed on destruction.

Meta