malloc<T extends NativeType> function
Allocates bytes on the module heap. Release the result with free.
Implementation
Pointer<T> malloc<T extends NativeType>(int numBytes) {
final ptr = _lib._malloc<T>(numBytes);
if (ptr != nullptr) _heapAllocations.add(ptr);
return ptr;
}