allocWith static method

UnsafeBytes allocWith(
  1. UnsafeAllocator allocator,
  2. int length
)

Opt-in external allocation. freeWith must use the same allocator in the same isolate; free remains the system-allocator path.

Implementation

static UnsafeBytes allocWith(UnsafeAllocator allocator, int length) =>
    UnsafeBytes._(allocator.alloc(length));