[Home] Type Microsoft.FSharp.NativeInterop.NativeArray


This type wraps a pointer to a blob of unmanaged memory assumed to contain a C-style one-dimensional array of items compatible with the (presumably blittable) type 'a. The blob of memory must be allocated and managed externally, e.g. by a computation routine written in C. All operations on this type are marked inlined because the code used to implement the operations is not verifiable. Any code that uses these operations will be unverifiable and may cause memory corruption if not used with extreme care.

Full Type Signature

type NativeArray<'a>
  with
    static member FromPtr : startAddress:'a nativeptr * length:int -> NativeArray<'a>
    [<UnverifiableAttribute ()>]
    member Item : int -> 'a with get
    member Length : int
    member Ptr : 'a nativeptr
    [<UnverifiableAttribute ()>]
    member Item : int -> 'a with set
  end

Instance Members

MemberDescription
[<UnverifiableAttribute ()>]
member Item : int -> 'a with get
WARNING: use of this function may lead to unverifiable or invalid code
[<UnverifiableAttribute ()>]
member Item : int -> 'a with set
WARNING: use of this function may lead to unverifiable or invalid code
member Length : int
Length of the C-style one-dimensional array
member Ptr : 'a nativeptr
Pointer to the C-style one-dimensional array

Static Members

MemberDescription
member FromPtr : startAddress:'a nativeptr * length:int -> NativeArray<'a>
Creates a C-style one dimensional array from a native pointer and the length of the array Nothing is actually copied.

See Also

Microsoft.FSharp.NativeInterop


Documentation for assembly FSharp.Core, version 1.9.4.19, generated using F# version 1.9.4.19