registerAllocator method

void registerAllocator(
  1. String key,
  2. RaylibTempAllocatorBase<RaylibTempBase<RaylibBase>, dynamic, dynamic> alloc
)

Registers a custom allocator under key. Throws StateError if key is already taken.

Implementation

void registerAllocator(String key, RaylibTempAllocatorBase alloc) {
  if (customAllocators.containsKey(key)) {
    final sig = customAllocators[key]!.signature();
    throw StateError("Allocator '$key' ('$sig') already exists!");
  }

  customAllocators[key] = alloc;
}