allocate<T extends NativeType> method
Provides sodium_malloc.
See https://libsodium.gitbook.io/doc/memory_management#guarded-heap-allocations
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();
}