call method - AllocatorAlloc extension - dart:ffi library (original) (raw)
call<T extends SizedNativeType> method
Pointer<T> call<T extends SizedNativeType>([
- int count = 1 ])
Allocates sizeOf<T>() * count
bytes of memory using allocate.
// This allocates eight bytes, which is enough space for two Int32's.
allocator<Int32>(2);
This extension method must be invoked with a compile-time constant T
.
To allocate a specific number of bytes, not just a multiple ofsizeOf<T>()
, use allocate. To allocate with a non constant T
, use allocate. Prefer call for normal use, and use allocate for implementing anAllocator in terms of other allocators.
Implementation
external Pointer<T> call<T extends SizedNativeType>([int count = 1]);