RaylibTempAllocator<R extends RType> class

Base class for Raylib temporary allocators, managing typed memory slots with a consistent allocation/free lifecycle.

Constructors

RaylibTempAllocator(RaylibTemp<RaylibBase> temp, {required int byteSize})

Properties

byteSize → int
Size in bytes of a single element this allocator manages.
final
hashCode → int
The hash code for this object.
no setterinherited
name ↔ String
Debug name for this allocator, used in logging and diagnostics.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slots → Map<String, (MemoryPointer<R>, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
final
temp → RaylibTemp<RaylibBase>
final

Methods

At(String key, [int count = 1]) → MemoryPointer<R>
Returns the pointer stored in key, allocating (or reallocating) if necessary.
AtUnique({String key = '@unique:', int count = 1}) → MemoryPointer<R>
Allocates (or reuses) a slot identified by a unique key suffix.
dispose() → void
Frees all currently tracked slots and clears the slot table.
Free(String key) → void
Frees the native memory owned by slot key and removes it from the table.
Has(String key) → bool
Returns true if a slot with the given key exists.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Raw([int count = 1]) → MemoryPointer<R>
Allocates count raw elements and returns the wrapped pointer.
Size([int count = 1]) → int
Returns the total byte size for count elements.
Slot(String key) → MemoryPointer<R>?
Returns the pointer stored under key, or null if the slot does not exist. Does not allocate.
toString() → String
A string representation of this object.
inherited
Unslot(String key) → void
Removes the slot entry for key from the table without freeing the underlying memory.

Operators

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