package ctypes

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ctypes_bigarraySource

Types

Sourcetype ('a, 'b, 'l) t

The type of bigarray values of particular sizes. A value of type (a, b, l) t can be used to read and write values of type b.

Type constructors

Sourceval bigarray : int array -> ('a, 'b) Bigarray_compat.kind -> 'l Bigarray_compat.layout -> ('a, ('a, 'b, 'l) Bigarray_compat.Genarray.t, 'l) t

Create a t value for the Bigarray.Genarray.t type.

Sourceval bigarray1 : int -> ('a, 'b) Bigarray_compat.kind -> 'l Bigarray_compat.layout -> ('a, ('a, 'b, 'l) Bigarray_compat.Array1.t, 'l) t

Create a t value for the Bigarray.Array1.t type.

Sourceval bigarray2 : int -> int -> ('a, 'b) Bigarray_compat.kind -> 'l Bigarray_compat.layout -> ('a, ('a, 'b, 'l) Bigarray_compat.Array2.t, 'l) t

Create a t value for the Bigarray.Array2.t type.

Sourceval bigarray3 : int -> int -> int -> ('a, 'b) Bigarray_compat.kind -> 'l Bigarray_compat.layout -> ('a, ('a, 'b, 'l) Bigarray_compat.Array3.t, 'l) t

Create a t value for the Bigarray.Array3.t type.

Create a Ctypes_ptr.Types.ctype for a Bigarray.kind.

Type eliminators

Sourceval sizeof : (_, _, _) t -> int

Compute the size of a bigarray type.

Sourceval alignment : (_, _, _) t -> int

Compute the alignment of a bigarray type.

Sourceval element_type : ('a, _, _) t -> 'a Ctypes_primitive_types.prim

Compute the element type of a bigarray type.

Sourceval dimensions : (_, _, _) t -> int array

Compute the dimensions of a bigarray type.

Sourceval type_expression : ('a, 'b, 'l) t -> [> `Appl of string list * 'c list | `Ident of string list ] as 'c

Compute a type expression that denotes a bigarray type.

Values

Sourceval unsafe_address : 'a -> Ctypes_ptr.voidp

Return the address of a bigarray value. This function is unsafe because it dissociates the raw address of the C array from the OCaml object that manages the lifetime of the array. If the caller does not hold a reference to the OCaml object then the array might be freed, invalidating the address.

Sourceval view : (_, 'a, _) t -> (_ option, _) Ctypes_ptr.Fat.t -> 'a

view b ptr creates a bigarray view onto existing memory.

If ptr references an OCaml object then view will ensure that that object is not collected before the bigarray returned by view.

OCaml

Innovation. Community. Security.