allocate<T extends NativeType> method

  1. @override
Pointer<T> allocate<T extends NativeType>(
  1. int byteCount, {
  2. int? alignment,
})
override

Implementation

@override
Pointer<T> allocate<T extends NativeType>(int byteCount, {int? alignment}) {
  if (alignment != null) {
    throw ArgumentError('Cannot align memory when using SodiumAllocator');
  }

  return sodium.sodium_malloc(byteCount).cast();
}