Compartir a través de


NativeInterop.NativePtr Module (F#)

Contains operations on native pointers. Use of these operators may result in the generation of unverifiable code.

Namespace/Module Path: Microsoft.FSharp.NativeInterop

Assembly: FSharp.Core (in FSharp.Core.dll)

module NativePtr

Values

Value

Description

add : nativeptr<'T> -> int -> nativeptr<'T>

Returns a typed native pointer by adding an offset to the given input pointer.

get : nativeptr<'T> -> int -> 'T

Dereferences the typed native pointer computed by adding an offset to the given input pointer.

ofNativeInt : nativeint -> nativeptr<'T>

Returns a typed native pointer for a given machine address.

read : nativeptr<'T> -> 'T

Dereferences the given typed native pointer.

set : nativeptr<'T> -> int -> 'T -> unit

Assigns a value into the memory location referenced by the typed native pointer computed by adding an offset to the given input pointer.

stackalloc : int -> nativeptr<'T>

Allocates a region of memory on the stack.

toNativeInt : nativeptr<'T> -> nativeint

Returns a machine address for a given typed native pointer.

write : nativeptr<'T> -> 'T -> unit

Assigns a value into the memory location referenced by the given typed native pointer.

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Reference

Microsoft.FSharp.NativeInterop Namespace (F#)