TrackingAllocator class sealed

Base class for allocators that integrate with the leak tracker.

Concrete subclasses allocate native memory using platform-appropriate APIs and register allocation metadata for leak analysis when leak tracking is enabled.

Exposes nativeFree so that a NativeFinalizer can automatically release memory if the owning Dart object is garbage collected before free is called manually.

Implemented types
Implementers
Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
nativeFree Pointer<NativeFinalizerFunction>
A pointer to the native free function used by this allocator.
no setter
nativeFree Pointer<NativeFinalizerFunction>

Available on Allocator, provided by the AllocatorExtensions extension

A pointer to the platform's native free function.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

allocate<T extends NativeType>(int byteCount, {int? alignment}) Pointer<T>
Allocates byteCount bytes of memory on the native heap.
inherited
call<T extends SizedNativeType>([int count = 1]) Pointer<T>

Available on Allocator, provided by the AllocatorAlloc extension

Allocates sizeOf<T>() * count bytes of memory using allocate.
free(Pointer<NativeType> pointer) → void
Releases memory allocated on the native heap.
inherited
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