call<T extends NativeType> method Null safety

Pointer<T> call<T extends NativeType>(
  1. [int count = 1]

Allocates sizeOf<T>() * count bytes of memory using allocate.

// This allocates eight bytes, which is enough space for two Int32's.

This extension method must be invoked with a compile-time constant T.

To allocate a specific number of bytes, not just a multiple of sizeOf<T>(), use allocate. To allocate with a non constant T, use allocate. Prefer call for normal use, and use allocate for implementing an Allocator in terms of other allocators.


external Pointer<T> call<T extends NativeType>([int count = 1]);