OrtAllocator class final

\brief Memory allocation interface

Structure of function pointers that defines a memory allocator. This can be created and filled in by the user for custom allocators.

When an allocator is passed to any function, be sure that the allocator object is not destroyed until the last allocated object using it is freed.

Inheritance
Implemented types
Available extensions

Constructors

OrtAllocator()

Properties

address Pointer<T>

Available on T, provided by the StructAddress extension

The memory address of the underlying data.
no setter
Alloc Pointer<NativeFunction<Pointer<Void> Function(Pointer<OrtAllocator> this_, Size size)>>
Returns a pointer to an allocated block of size bytes
getter/setter pair
AllocOnStream Pointer<NativeFunction<Pointer<Void> Function(Pointer<OrtAllocator> this_, Size size, Pointer<OrtSyncStream> stream)>>
\brief Allocate using a stream.
getter/setter pair
Free Pointer<NativeFunction<Void Function(Pointer<OrtAllocator> this_, Pointer<Void> p)>>
Free a block of memory previously allocated with OrtAllocator::Alloc
getter/setter pair
GetStats Pointer<NativeFunction<OrtStatusPtr Function(Pointer<OrtAllocator> this_, Pointer<Pointer<OrtKeyValuePairs>> out)>>
@brief Function used to get the statistics of the allocator.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
Info Pointer<NativeFunction<Pointer<OrtMemoryInfo> Function(Pointer<OrtAllocator> this_)>>
Return a pointer to an ::OrtMemoryInfo that describes this allocator
getter/setter pair
Reserve Pointer<NativeFunction<Pointer<Void> Function(Pointer<OrtAllocator> this_, Size size)>>
@brief Optional allocation function to use for memory allocations made during session initialization. Use this function if you want to separate allocations made by ORT during Run() calls from those made during session initialization. This allows for separate memory management strategies for these allocations.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
version int
< Must be initialized to ORT_API_VERSION
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited