FFIArray.fromData

Zero-copy conversion of a native D slice to an FFIArray. The resulting FFIArray has the same lifetime as the native D slice, so a stack allocated slice will also cause the FFIArray to become invalid when leaving its scope. DIP1000 should help avoid such issues.

  1. FFIArray fromData(T[] data)
  2. FFIArray fromData(T[n] data)
    struct FFIArray(T)
    static @trusted nothrow pure @nogc
    fromData
    (
    size_t n
    )
    (
    return ref T[n] data
    )

Meta