Header menu logo FSharp.Core

NativePtr Module

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

Functions and values

Function or value Description

NativePtr.add address index

Full Usage: NativePtr.add address index

Parameters:
    address : nativeptr<'T> - The input pointer.
    index : int - The index by which to offset the pointer.

Returns: nativeptr<'T> A typed pointer.
Modifiers: inline
Type parameters: 'T

Returns a typed native pointer by adding index * sizeof<'T> to the given input pointer.

address : nativeptr<'T>

The input pointer.

index : int

The index by which to offset the pointer.

Returns: nativeptr<'T>

A typed pointer.

NativePtr.clear address

Full Usage: NativePtr.clear address

Parameters:
    address : nativeptr<'T> - The input pointer.

Modifiers: inline
Type parameters: 'T

Clears the value stored at the location of a given native pointer.

address : nativeptr<'T>

The input pointer.

NativePtr.copy destination source

Full Usage: NativePtr.copy destination source

Parameters:
    destination : nativeptr<'T> - The destination pointer.
    source : nativeptr<'T> - The source pointer.

Modifiers: inline
Type parameters: 'T

Copies a value to a specified destination address from a specified source address.

destination : nativeptr<'T>

The destination pointer.

source : nativeptr<'T>

The source pointer.

NativePtr.copyBlock destination source count

Full Usage: NativePtr.copyBlock destination source count

Parameters:
    destination : nativeptr<'T> - The destination pointer.
    source : nativeptr<'T> - The source pointer.
    count : int - The source pointer.

Modifiers: inline
Type parameters: 'T

Copies a block of memory to a specified destination address starting from a specified source address until a specified byte count of (count * sizeof<'T>).

destination : nativeptr<'T>

The destination pointer.

source : nativeptr<'T>

The source pointer.

count : int

The source pointer.

NativePtr.get address index

Full Usage: NativePtr.get address index

Parameters:
    address : nativeptr<'T> - The input pointer.
    index : int - The index by which to offset the pointer.

Returns: 'T The value at the pointer address.
Modifiers: inline
Type parameters: 'T

Dereferences the typed native pointer computed by adding index * sizeof<'T> to the given input pointer.

address : nativeptr<'T>

The input pointer.

index : int

The index by which to offset the pointer.

Returns: 'T

The value at the pointer address.

NativePtr.initBlock address value count

Full Usage: NativePtr.initBlock address value count

Parameters:
    address : nativeptr<'T> - The input pointer.
    value : byte - The initial byte value.
    count : uint32 - The total repeat count of the byte value.

Modifiers: inline
Type parameters: 'T

Initializes a specified block of memory starting at a specific address to a given byte count and initial byte value.

address : nativeptr<'T>

The input pointer.

value : byte

The initial byte value.

count : uint32

The total repeat count of the byte value.

NativePtr.isNullPtr address

Full Usage: NativePtr.isNullPtr address

Parameters:
    address : nativeptr<'T> - The input pointer.

Returns: bool Whether the given native pointer is null.
Modifiers: inline
Type parameters: 'T

Tests whether the given native pointer is null.

address : nativeptr<'T>

The input pointer.

Returns: bool

Whether the given native pointer is null.

NativePtr.nullPtr

Full Usage: NativePtr.nullPtr

Returns: nativeptr<'T> The null native pointer.
Modifiers: inline
Type parameters: 'T

Gets the null native pointer.

Returns: nativeptr<'T>

The null native pointer.

NativePtr.ofILSigPtr address

Full Usage: NativePtr.ofILSigPtr address

Parameters:
    address : ilsigptr<'T> - The Common IL signature pointer.

Returns: nativeptr<'T> A typed native pointer.
Modifiers: inline
Type parameters: 'T

Returns a typed native pointer for a Common IL (Intermediate Language) signature pointer.

address : ilsigptr<'T>

The Common IL signature pointer.

Returns: nativeptr<'T>

A typed native pointer.

NativePtr.ofNativeInt address

Full Usage: NativePtr.ofNativeInt address

Parameters:
Returns: nativeptr<'T> A typed native pointer.
Modifiers: inline
Type parameters: 'T

Returns a typed native pointer for a given machine address.

address : nativeint

The machine address.

Returns: nativeptr<'T>

A typed native pointer.

NativePtr.ofVoidPtr address

Full Usage: NativePtr.ofVoidPtr address

Parameters:
    address : voidptr - The untyped native pointer.

Returns: nativeptr<'T> A typed native pointer.
Modifiers: inline
Type parameters: 'T

Returns a typed native pointer for a untyped native pointer.

address : voidptr

The untyped native pointer.

Returns: nativeptr<'T>

A typed native pointer.

NativePtr.read address

Full Usage: NativePtr.read address

Parameters:
    address : nativeptr<'T> - The input pointer.

Returns: 'T The value at the pointer address.
Modifiers: inline
Type parameters: 'T

Dereferences the given typed native pointer.

address : nativeptr<'T>

The input pointer.

Returns: 'T

The value at the pointer address.

NativePtr.set address index value

Full Usage: NativePtr.set address index value

Parameters:
    address : nativeptr<'T> - The input pointer.
    index : int - The index by which to offset the pointer.
    value : 'T - The value to assign.

Modifiers: inline
Type parameters: 'T

Assigns the value into the memory location referenced by the typed native pointer computed by adding index * sizeof<'T> to the given input pointer.

address : nativeptr<'T>

The input pointer.

index : int

The index by which to offset the pointer.

value : 'T

The value to assign.

NativePtr.stackalloc count

Full Usage: NativePtr.stackalloc count

Parameters:
    count : int - The number of objects of type T to allocate.

Returns: nativeptr<'T> A typed pointer to the allocated memory.
Modifiers: inline
Type parameters: 'T

Allocates a region of memory on the stack.

count : int

The number of objects of type T to allocate.

Returns: nativeptr<'T>

A typed pointer to the allocated memory.

NativePtr.toByRef address

Full Usage: NativePtr.toByRef address

Parameters:
    address : nativeptr<'T> - The typed native pointer.

Returns: byref<'T> The managed pointer.
Modifiers: inline
Type parameters: 'T

Converts a given typed native pointer to a managed pointer.

address : nativeptr<'T>

The typed native pointer.

Returns: byref<'T>

The managed pointer.

NativePtr.toILSigPtr address

Full Usage: NativePtr.toILSigPtr address

Parameters:
    address : nativeptr<'T> - The typed native pointer.

Returns: ilsigptr<'T> A Common IL signature pointer.
Modifiers: inline
Type parameters: 'T

Returns a Common IL (Intermediate Language) signature pointer for a given typed native pointer.

address : nativeptr<'T>

The typed native pointer.

Returns: ilsigptr<'T>

A Common IL signature pointer.

NativePtr.toNativeInt address

Full Usage: NativePtr.toNativeInt address

Parameters:
    address : nativeptr<'T> - The typed native pointer.

Returns: nativeint The machine address.
Modifiers: inline
Type parameters: 'T

Returns a machine address for a given typed native pointer.

address : nativeptr<'T>

The typed native pointer.

Returns: nativeint

The machine address.

NativePtr.toVoidPtr address

Full Usage: NativePtr.toVoidPtr address

Parameters:
    address : nativeptr<'T> - The typed native pointer.

Returns: voidptr An untyped native pointer.
Modifiers: inline
Type parameters: 'T

Returns an untyped native pointer for a given typed native pointer.

address : nativeptr<'T>

The typed native pointer.

Returns: voidptr

An untyped native pointer.

NativePtr.write address value

Full Usage: NativePtr.write address value

Parameters:
    address : nativeptr<'T> - The input pointer.
    value : 'T - The value to assign.

Modifiers: inline
Type parameters: 'T

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

address : nativeptr<'T>

The input pointer.

value : 'T

The value to assign.

Type something to start searching.