package core_kernel

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

This module extends Base.Blit.

include module type of struct include Base.Blit end
type nonrec ('src, 'dst) blit = src:'src -> src_pos:int -> dst:'dst -> dst_pos:int -> len:int -> unit
type nonrec ('src, 'dst) blito = src:'src -> ?src_pos:int -> ?src_len:int -> dst:'dst -> ?dst_pos:int -> unit -> unit
type nonrec ('src, 'dst) sub = 'src -> pos:int -> len:int -> 'dst
type nonrec ('src, 'dst) subo = ?pos:int -> ?len:int -> 'src -> 'dst
module type S = Blit.S
module type S1 = Blit.S1
module type S_distinct = Blit.S_distinct
module type Sequence = Blit.Sequence
module type Sequence1 = Blit.Sequence1

There are various Make* functors that turn an unsafe_blit function into a blit function. The functors differ in whether the sequence type is monomorphic or polymorphic, and whether the src and dst types are distinct or are the same.

The blit functions make sure the slices are valid and then call unsafe_blit. They guarantee at a call unsafe_blit ~src ~src_pos ~dst ~dst_pos ~len that:

len > 0
&& src_pos >= 0
&& src_pos + len <= get_src_len src
&& dst_pos >= 0
&& dst_pos + len <= get_dst_len dst

The Make* functors also automatically create unit tests.

module Make = Base.Blit.Make

Make is for blitting between two values of the same monomorphic type.

module Make_distinct = Base.Blit.Make_distinct

Make_distinct is for blitting between values of distinct monomorphic types.

module Make1 = Base.Blit.Make1

Make1 is for blitting between two values of the same polymorphic type.

module Make1_generic = Base.Blit.Make1_generic

Make1_generic is for blitting between two values of the same container type that's not fully polymorphic (in the sense of Container.Generic).

OCaml

Innovation. Community. Security.